@@ -591,6 +591,104 @@ library
591591''' );
592592 }
593593
594+ test_const_dotShorthand_property () async {
595+ var library = await buildLibrary (r'''
596+ class A {
597+ static const A a = A();
598+ const A();
599+ }
600+
601+ const A a = .a;
602+ ''' );
603+ checkElementText (library, r'''
604+ library
605+ reference: <testLibrary>
606+ fragments
607+ <testLibraryFragment>
608+ element: <testLibrary>
609+ classes
610+ class A @6
611+ reference: <testLibraryFragment>::@class::A
612+ element: <testLibrary>::@class::A
613+ fields
614+ hasInitializer a @27
615+ reference: <testLibraryFragment>::@class::A::@field::a
616+ element: <testLibraryFragment>::@class::A::@field::a#element
617+ initializer: expression_0
618+ InstanceCreationExpression
619+ constructorName: ConstructorName
620+ type: NamedType
621+ name: A @31
622+ element2: <testLibrary>::@class::A
623+ type: A
624+ element: <testLibraryFragment>::@class::A::@constructor::new#element
625+ argumentList: ArgumentList
626+ leftParenthesis: ( @32
627+ rightParenthesis: ) @33
628+ staticType: A
629+ getter2: <testLibraryFragment>::@class::A::@getter::a
630+ constructors
631+ const new
632+ reference: <testLibraryFragment>::@class::A::@constructor::new
633+ element: <testLibraryFragment>::@class::A::@constructor::new#element
634+ typeName: A
635+ typeNameOffset: 44
636+ getters
637+ synthetic get a
638+ reference: <testLibraryFragment>::@class::A::@getter::a
639+ element: <testLibraryFragment>::@class::A::@getter::a#element
640+ topLevelVariables
641+ hasInitializer a @60
642+ reference: <testLibraryFragment>::@topLevelVariable::a
643+ element: <testLibrary>::@topLevelVariable::a
644+ initializer: expression_1
645+ DotShorthandPropertyAccess
646+ period: . @64
647+ propertyName: SimpleIdentifier
648+ token: a @65
649+ element: <testLibraryFragment>::@class::A::@getter::a#element
650+ staticType: A
651+ staticType: A
652+ getter2: <testLibraryFragment>::@getter::a
653+ getters
654+ synthetic get a
655+ reference: <testLibraryFragment>::@getter::a
656+ element: <testLibraryFragment>::@getter::a#element
657+ classes
658+ class A
659+ reference: <testLibrary>::@class::A
660+ firstFragment: <testLibraryFragment>::@class::A
661+ fields
662+ static const hasInitializer a
663+ firstFragment: <testLibraryFragment>::@class::A::@field::a
664+ type: A
665+ constantInitializer
666+ fragment: <testLibraryFragment>::@class::A::@field::a
667+ expression: expression_0
668+ getter: <testLibraryFragment>::@class::A::@getter::a#element
669+ constructors
670+ const new
671+ firstFragment: <testLibraryFragment>::@class::A::@constructor::new
672+ getters
673+ synthetic static get a
674+ firstFragment: <testLibraryFragment>::@class::A::@getter::a
675+ returnType: A
676+ topLevelVariables
677+ const hasInitializer a
678+ reference: <testLibrary>::@topLevelVariable::a
679+ firstFragment: <testLibraryFragment>::@topLevelVariable::a
680+ type: A
681+ constantInitializer
682+ fragment: <testLibraryFragment>::@topLevelVariable::a
683+ expression: expression_1
684+ getter: <testLibraryFragment>::@getter::a#element
685+ getters
686+ synthetic static get a
687+ firstFragment: <testLibraryFragment>::@getter::a
688+ returnType: A
689+ ''' );
690+ }
691+
594692 test_const_finalField_hasConstConstructor () async {
595693 var library = await buildLibrary (r'''
596694class C {
0 commit comments