@@ -908,27 +908,27 @@ Function(int, String) v;
908
908
expect(method.body, isNotNull);
909
909
}
910
910
911
- void test_parseClassMember_method_get_type () {
912
- createParser('int get() {} ');
911
+ void test_parseClassMember_method_get_static_namedAsClass () {
912
+ createParser('static int get C => 0; ');
913
913
ClassMember member = parser.parseClassMember('C');
914
914
expect(member, isNotNull);
915
915
assertNoErrors();
916
916
expect(member, new TypeMatcher<MethodDeclaration>());
917
917
MethodDeclaration method = member;
918
918
expect(method.documentationComment, isNull);
919
919
expect(method.externalKeyword, isNull);
920
- expect(method.modifierKeyword, isNull );
921
- expect(method.propertyKeyword, isNull );
920
+ expect(method.modifierKeyword, isNotNull );
921
+ expect(method.propertyKeyword, isNotNull );
922
922
expect(method.returnType, isNotNull);
923
923
expect(method.name, isNotNull);
924
924
expect(method.operatorKeyword, isNull);
925
925
expect(method.typeParameters, isNull);
926
- expect(method.parameters, isNotNull );
926
+ expect(method.parameters, isNull );
927
927
expect(method.body, isNotNull);
928
928
}
929
929
930
- void test_parseClassMember_method_get_void () {
931
- createParser('void get() {}');
930
+ void test_parseClassMember_method_get_type () {
931
+ createParser('int get() {}');
932
932
ClassMember member = parser.parseClassMember('C');
933
933
expect(member, isNotNull);
934
934
assertNoErrors();
@@ -946,36 +946,17 @@ Function(int, String) v;
946
946
expect(method.body, isNotNull);
947
947
}
948
948
949
- void test_parseClassMember_method_get_static_namedAsClass() {
950
- createParser('static int get C => 0;');
951
- ClassMember member = parser.parseClassMember('C');
952
- expect(member, isNotNull);
953
- assertNoErrors();
954
- expect(member, new TypeMatcher<MethodDeclaration>());
955
- MethodDeclaration method = member;
956
- expect(method.documentationComment, isNull);
957
- expect(method.externalKeyword, isNull);
958
- expect(method.modifierKeyword, isNotNull);
959
- expect(method.propertyKeyword, isNotNull);
960
- expect(method.returnType, isNotNull);
961
- expect(method.name, isNotNull);
962
- expect(method.operatorKeyword, isNull);
963
- expect(method.typeParameters, isNull);
964
- expect(method.parameters, isNull);
965
- expect(method.body, isNotNull);
966
- }
967
-
968
- void test_parseClassMember_method_set_static_namedAsClass() {
969
- createParser('static void set C(_) {}');
949
+ void test_parseClassMember_method_get_void() {
950
+ createParser('void get() {}');
970
951
ClassMember member = parser.parseClassMember('C');
971
952
expect(member, isNotNull);
972
953
assertNoErrors();
973
954
expect(member, new TypeMatcher<MethodDeclaration>());
974
955
MethodDeclaration method = member;
975
956
expect(method.documentationComment, isNull);
976
957
expect(method.externalKeyword, isNull);
977
- expect(method.modifierKeyword, isNotNull );
978
- expect(method.propertyKeyword, isNotNull );
958
+ expect(method.modifierKeyword, isNull );
959
+ expect(method.propertyKeyword, isNull );
979
960
expect(method.returnType, isNotNull);
980
961
expect(method.name, isNotNull);
981
962
expect(method.operatorKeyword, isNull);
@@ -1195,6 +1176,25 @@ void Function<A>(core.List<core.int> x) m() => null;
1195
1176
expect(method.body, isNotNull);
1196
1177
}
1197
1178
1179
+ void test_parseClassMember_method_set_static_namedAsClass() {
1180
+ createParser('static void set C(_) {}');
1181
+ ClassMember member = parser.parseClassMember('C');
1182
+ expect(member, isNotNull);
1183
+ assertNoErrors();
1184
+ expect(member, new TypeMatcher<MethodDeclaration>());
1185
+ MethodDeclaration method = member;
1186
+ expect(method.documentationComment, isNull);
1187
+ expect(method.externalKeyword, isNull);
1188
+ expect(method.modifierKeyword, isNotNull);
1189
+ expect(method.propertyKeyword, isNotNull);
1190
+ expect(method.returnType, isNotNull);
1191
+ expect(method.name, isNotNull);
1192
+ expect(method.operatorKeyword, isNull);
1193
+ expect(method.typeParameters, isNull);
1194
+ expect(method.parameters, isNotNull);
1195
+ expect(method.body, isNotNull);
1196
+ }
1197
+
1198
1198
void test_parseClassMember_method_set_type() {
1199
1199
createParser('int set() {}');
1200
1200
ClassMember member = parser.parseClassMember('C');
@@ -3948,6 +3948,15 @@ class Wrong<T> {
3948
3948
expectNotNullIfNoErrors(literal);
3949
3949
}
3950
3950
3951
+ void test_invalidInlineFunctionType() {
3952
+ parseCompilationUnit(
3953
+ 'typedef F = int Function(int a());',
3954
+ errors: [
3955
+ expectedError(CompileTimeErrorCode.INVALID_INLINE_FUNCTION_TYPE, 30, 1)
3956
+ ],
3957
+ );
3958
+ }
3959
+
3951
3960
void test_invalidInterpolationIdentifier_startWithDigit() {
3952
3961
StringLiteral literal = parseExpression("'\$1'", errors: [
3953
3962
usingFastaParser
0 commit comments