diff --git a/test/dot_shorthands_test.dart b/test/dot_shorthands_test.dart index 5b236cb719..76d3efb29f 100644 --- a/test/dot_shorthands_test.dart +++ b/test/dot_shorthands_test.dart @@ -114,4 +114,18 @@ void m(){} expect(m.hasAnnotations, true); } + + void test_doc_dot_shorthand_const_init_success() async { + // Constant initializers are not linked so this test is just to make sure we + // don't crash. + var library = await bootPackageWithLibrary(''' +enum Color { + red, green +} +const Color favColor = .green; +'''); + var m = library.constants.named('favColor'); + + expect(m.hasDocumentation, false); + } }