@@ -922,28 +922,13 @@ mixin ConstructorElementMixin
922922
923923 /// Whether the constructor can be used as a default constructor - unnamed,
924924 /// and has no required parameters.
925- bool get isDefaultConstructor {
926- // unnamed
927- if (name2 != 'new' ) {
928- return false ;
929- }
930- // no required parameters
931- for (var parameter in parameters) {
932- if (parameter.isRequired) {
933- return false ;
934- }
935- }
936- // OK, can be used as default constructor
937- return true ;
938- }
925+ bool get isDefaultConstructor;
939926
940927 /// Whether the constructor represents a factory constructor.
941928 bool get isFactory;
942929
943930 /// Whether the constructor represents a generative constructor.
944- bool get isGenerative {
945- return ! isFactory;
946- }
931+ bool get isGenerative;
947932
948933 @override
949934 LibraryElementImpl get library2;
@@ -1066,6 +1051,22 @@ class ConstructorFragmentImpl extends ExecutableFragmentImpl
10661051 setModifier (Modifier .CONST , isConst);
10671052 }
10681053
1054+ @override
1055+ bool get isDefaultConstructor {
1056+ // unnamed
1057+ if (name2 != 'new' ) {
1058+ return false ;
1059+ }
1060+ // no required parameters
1061+ for (var parameter in parameters) {
1062+ if (parameter.isRequired) {
1063+ return false ;
1064+ }
1065+ }
1066+ // OK, can be used as default constructor
1067+ return true ;
1068+ }
1069+
10691070 @override
10701071 bool get isFactory {
10711072 return hasModifier (Modifier .FACTORY );
@@ -1076,6 +1077,11 @@ class ConstructorFragmentImpl extends ExecutableFragmentImpl
10761077 setModifier (Modifier .FACTORY , isFactory);
10771078 }
10781079
1080+ @override
1081+ bool get isGenerative {
1082+ return ! isFactory;
1083+ }
1084+
10791085 @override
10801086 ElementKind get kind => ElementKind .CONSTRUCTOR ;
10811087
0 commit comments