@@ -922,28 +922,13 @@ mixin ConstructorElementMixin
922
922
923
923
/// Whether the constructor can be used as a default constructor - unnamed,
924
924
/// 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;
939
926
940
927
/// Whether the constructor represents a factory constructor.
941
928
bool get isFactory;
942
929
943
930
/// Whether the constructor represents a generative constructor.
944
- bool get isGenerative {
945
- return ! isFactory;
946
- }
931
+ bool get isGenerative;
947
932
948
933
@override
949
934
LibraryElementImpl get library2;
@@ -1066,6 +1051,22 @@ class ConstructorFragmentImpl extends ExecutableFragmentImpl
1066
1051
setModifier (Modifier .CONST , isConst);
1067
1052
}
1068
1053
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
+
1069
1070
@override
1070
1071
bool get isFactory {
1071
1072
return hasModifier (Modifier .FACTORY );
@@ -1076,6 +1077,11 @@ class ConstructorFragmentImpl extends ExecutableFragmentImpl
1076
1077
setModifier (Modifier .FACTORY , isFactory);
1077
1078
}
1078
1079
1080
+ @override
1081
+ bool get isGenerative {
1082
+ return ! isFactory;
1083
+ }
1084
+
1079
1085
@override
1080
1086
ElementKind get kind => ElementKind .CONSTRUCTOR ;
1081
1087
0 commit comments