@@ -588,6 +588,141 @@ library
588588''' );
589589 }
590590
591+ test_const_dotShorthand_constructor_explicit () async {
592+ var library = await buildLibrary (r'''
593+ class A {
594+ const A();
595+ }
596+
597+ const A a = const .new();
598+ ''' );
599+ checkElementText (library, r'''
600+ library
601+ reference: <testLibrary>
602+ fragments
603+ <testLibraryFragment>
604+ element: <testLibrary>
605+ classes
606+ class A @6
607+ reference: <testLibraryFragment>::@class::A
608+ element: <testLibrary>::@class::A
609+ constructors
610+ const new
611+ reference: <testLibraryFragment>::@class::A::@constructor::new
612+ element: <testLibraryFragment>::@class::A::@constructor::new#element
613+ typeName: A
614+ typeNameOffset: 18
615+ topLevelVariables
616+ hasInitializer a @34
617+ reference: <testLibraryFragment>::@topLevelVariable::a
618+ element: <testLibrary>::@topLevelVariable::a
619+ initializer: expression_0
620+ DotShorthandConstructorInvocation
621+ const: const @38
622+ period: . @44
623+ constructorName: SimpleIdentifier
624+ token: new @45
625+ element: <testLibraryFragment>::@class::A::@constructor::new#element
626+ staticType: null
627+ argumentList: ArgumentList
628+ leftParenthesis: ( @48
629+ rightParenthesis: ) @49
630+ staticType: A
631+ getter2: <testLibraryFragment>::@getter::a
632+ getters
633+ synthetic get a
634+ reference: <testLibraryFragment>::@getter::a
635+ element: <testLibraryFragment>::@getter::a#element
636+ classes
637+ class A
638+ reference: <testLibrary>::@class::A
639+ firstFragment: <testLibraryFragment>::@class::A
640+ constructors
641+ const new
642+ firstFragment: <testLibraryFragment>::@class::A::@constructor::new
643+ topLevelVariables
644+ const hasInitializer a
645+ reference: <testLibrary>::@topLevelVariable::a
646+ firstFragment: <testLibraryFragment>::@topLevelVariable::a
647+ type: A
648+ constantInitializer
649+ fragment: <testLibraryFragment>::@topLevelVariable::a
650+ expression: expression_0
651+ getter: <testLibraryFragment>::@getter::a#element
652+ getters
653+ synthetic static get a
654+ firstFragment: <testLibraryFragment>::@getter::a
655+ returnType: A
656+ ''' );
657+ }
658+
659+ test_const_dotShorthand_constructor_implicit () async {
660+ var library = await buildLibrary (r'''
661+ class A {
662+ const A();
663+ }
664+
665+ const A a = .new();
666+ ''' );
667+ checkElementText (library, r'''
668+ library
669+ reference: <testLibrary>
670+ fragments
671+ <testLibraryFragment>
672+ element: <testLibrary>
673+ classes
674+ class A @6
675+ reference: <testLibraryFragment>::@class::A
676+ element: <testLibrary>::@class::A
677+ constructors
678+ const new
679+ reference: <testLibraryFragment>::@class::A::@constructor::new
680+ element: <testLibraryFragment>::@class::A::@constructor::new#element
681+ typeName: A
682+ typeNameOffset: 18
683+ topLevelVariables
684+ hasInitializer a @34
685+ reference: <testLibraryFragment>::@topLevelVariable::a
686+ element: <testLibrary>::@topLevelVariable::a
687+ initializer: expression_0
688+ DotShorthandConstructorInvocation
689+ period: . @38
690+ constructorName: SimpleIdentifier
691+ token: new @39
692+ element: <testLibraryFragment>::@class::A::@constructor::new#element
693+ staticType: null
694+ argumentList: ArgumentList
695+ leftParenthesis: ( @42
696+ rightParenthesis: ) @43
697+ staticType: A
698+ getter2: <testLibraryFragment>::@getter::a
699+ getters
700+ synthetic get a
701+ reference: <testLibraryFragment>::@getter::a
702+ element: <testLibraryFragment>::@getter::a#element
703+ classes
704+ class A
705+ reference: <testLibrary>::@class::A
706+ firstFragment: <testLibraryFragment>::@class::A
707+ constructors
708+ const new
709+ firstFragment: <testLibraryFragment>::@class::A::@constructor::new
710+ topLevelVariables
711+ const hasInitializer a
712+ reference: <testLibrary>::@topLevelVariable::a
713+ firstFragment: <testLibraryFragment>::@topLevelVariable::a
714+ type: A
715+ constantInitializer
716+ fragment: <testLibraryFragment>::@topLevelVariable::a
717+ expression: expression_0
718+ getter: <testLibraryFragment>::@getter::a#element
719+ getters
720+ synthetic static get a
721+ firstFragment: <testLibraryFragment>::@getter::a
722+ returnType: A
723+ ''' );
724+ }
725+
591726 test_const_dotShorthand_property () async {
592727 var library = await buildLibrary (r'''
593728class A {
0 commit comments