Index: pkg/analyzer/test/generated/resolver_test.dart |
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart |
index 7315085936cb31a3a651ff64223706bd48b115fd..b2e06e359f7b11e5b348b3442fa5d43ba7f43bd6 100644 |
--- a/pkg/analyzer/test/generated/resolver_test.dart |
+++ b/pkg/analyzer/test/generated/resolver_test.dart |
@@ -235,6 +235,26 @@ class TypePropagationTest extends ResolverTestCase { |
JUnitTestCase.assertSame(null, vIdentifier.propagatedType); |
} |
+ void test_functionExpression_asInvocationArgument_notSubtypeOfStaticType() { |
+ String code = EngineTestCase.createSource([ |
+ "class A {", |
+ " m(void f(int i)) {}", |
+ "}", |
+ "x() {", |
+ " A a = new A();", |
+ " a.m(() => 0);", |
+ "}"]); |
+ Source source = addSource(code); |
+ LibraryElement library = resolve(source); |
+ assertErrors(source, [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]); |
+ verify([source]); |
+ CompilationUnit unit = resolveCompilationUnit(source, library); |
+ // () => 0 |
+ FunctionExpression functionExpression = EngineTestCase.findNode(unit, code, "() => 0)", (node) => node is FunctionExpression); |
+ JUnitTestCase.assertSame(0, (functionExpression.staticType as FunctionType).parameters.length); |
+ JUnitTestCase.assertSame(null, functionExpression.propagatedType); |
+ } |
+ |
void test_functionExpression_asInvocationArgument_replaceIfMoreSpecific() { |
String code = EngineTestCase.createSource([ |
"class MyList<E> {", |
@@ -835,6 +855,10 @@ class TypePropagationTest extends ResolverTestCase { |
final __test = new TypePropagationTest(); |
runJUnitTest(__test, __test.test_functionExpression_asInvocationArgument_keepIfLessSpecific); |
}); |
+ _ut.test('test_functionExpression_asInvocationArgument_notSubtypeOfStaticType', () { |
+ final __test = new TypePropagationTest(); |
+ runJUnitTest(__test, __test.test_functionExpression_asInvocationArgument_notSubtypeOfStaticType); |
+ }); |
_ut.test('test_functionExpression_asInvocationArgument_replaceIfMoreSpecific', () { |
final __test = new TypePropagationTest(); |
runJUnitTest(__test, __test.test_functionExpression_asInvocationArgument_replaceIfMoreSpecific); |
@@ -11670,7 +11694,7 @@ class CompileTimeErrorCodeTest extends ResolverTestCase { |
verify([source]); |
} |
- void test_extendsDisallowedClass_bool() { |
+ void test_extendsDisallowedClass_class_bool() { |
Source source = addSource(EngineTestCase.createSource(["class A extends bool {}"])); |
resolve(source); |
assertErrors(source, [ |
@@ -11679,7 +11703,7 @@ class CompileTimeErrorCodeTest extends ResolverTestCase { |
verify([source]); |
} |
- void test_extendsDisallowedClass_double() { |
+ void test_extendsDisallowedClass_class_double() { |
Source source = addSource(EngineTestCase.createSource(["class A extends double {}"])); |
resolve(source); |
assertErrors(source, [ |
@@ -11688,7 +11712,7 @@ class CompileTimeErrorCodeTest extends ResolverTestCase { |
verify([source]); |
} |
- void test_extendsDisallowedClass_int() { |
+ void test_extendsDisallowedClass_class_int() { |
Source source = addSource(EngineTestCase.createSource(["class A extends int {}"])); |
resolve(source); |
assertErrors(source, [ |
@@ -11697,7 +11721,7 @@ class CompileTimeErrorCodeTest extends ResolverTestCase { |
verify([source]); |
} |
- void test_extendsDisallowedClass_Null() { |
+ void test_extendsDisallowedClass_class_Null() { |
Source source = addSource(EngineTestCase.createSource(["class A extends Null {}"])); |
resolve(source); |
assertErrors(source, [ |
@@ -11706,7 +11730,7 @@ class CompileTimeErrorCodeTest extends ResolverTestCase { |
verify([source]); |
} |
- void test_extendsDisallowedClass_num() { |
+ void test_extendsDisallowedClass_class_num() { |
Source source = addSource(EngineTestCase.createSource(["class A extends num {}"])); |
resolve(source); |
assertErrors(source, [ |
@@ -11715,7 +11739,7 @@ class CompileTimeErrorCodeTest extends ResolverTestCase { |
verify([source]); |
} |
- void test_extendsDisallowedClass_String() { |
+ void test_extendsDisallowedClass_class_String() { |
Source source = addSource(EngineTestCase.createSource(["class A extends String {}"])); |
resolve(source); |
assertErrors(source, [ |
@@ -11724,6 +11748,48 @@ class CompileTimeErrorCodeTest extends ResolverTestCase { |
verify([source]); |
} |
+ void test_extendsDisallowedClass_classTypeAlias_bool() { |
+ Source source = addSource(EngineTestCase.createSource(["class C = bool;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_extendsDisallowedClass_classTypeAlias_double() { |
+ Source source = addSource(EngineTestCase.createSource(["class C = double;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_extendsDisallowedClass_classTypeAlias_int() { |
+ Source source = addSource(EngineTestCase.createSource(["class C = int;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_extendsDisallowedClass_classTypeAlias_Null() { |
+ Source source = addSource(EngineTestCase.createSource(["class C = Null;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_extendsDisallowedClass_classTypeAlias_num() { |
+ Source source = addSource(EngineTestCase.createSource(["class C = num;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_extendsDisallowedClass_classTypeAlias_String() { |
+ Source source = addSource(EngineTestCase.createSource(["class C = String;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
void test_extendsNonClass_class() { |
Source source = addSource(EngineTestCase.createSource(["int A;", "class B extends A {}"])); |
resolve(source); |
@@ -11933,48 +11999,108 @@ class CompileTimeErrorCodeTest extends ResolverTestCase { |
verify([source]); |
} |
- void test_implementsDisallowedClass_bool() { |
+ void test_implementsDisallowedClass_class_bool() { |
Source source = addSource(EngineTestCase.createSource(["class A implements bool {}"])); |
resolve(source); |
assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]); |
verify([source]); |
} |
- void test_implementsDisallowedClass_double() { |
+ void test_implementsDisallowedClass_class_double() { |
Source source = addSource(EngineTestCase.createSource(["class A implements double {}"])); |
resolve(source); |
assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]); |
verify([source]); |
} |
- void test_implementsDisallowedClass_int() { |
+ void test_implementsDisallowedClass_class_int() { |
Source source = addSource(EngineTestCase.createSource(["class A implements int {}"])); |
resolve(source); |
assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]); |
verify([source]); |
} |
- void test_implementsDisallowedClass_Null() { |
+ void test_implementsDisallowedClass_class_Null() { |
Source source = addSource(EngineTestCase.createSource(["class A implements Null {}"])); |
resolve(source); |
assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]); |
verify([source]); |
} |
- void test_implementsDisallowedClass_num() { |
+ void test_implementsDisallowedClass_class_num() { |
Source source = addSource(EngineTestCase.createSource(["class A implements num {}"])); |
resolve(source); |
assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]); |
verify([source]); |
} |
- void test_implementsDisallowedClass_String() { |
+ void test_implementsDisallowedClass_class_String() { |
Source source = addSource(EngineTestCase.createSource(["class A implements String {}"])); |
resolve(source); |
assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]); |
verify([source]); |
} |
+ void test_implementsDisallowedClass_class_String_num() { |
+ Source source = addSource(EngineTestCase.createSource(["class A implements String, num {}"])); |
+ resolve(source); |
+ assertErrors(source, [ |
+ CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, |
+ CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_implementsDisallowedClass_classTypeAlias_bool() { |
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "class C = A implements bool;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_implementsDisallowedClass_classTypeAlias_double() { |
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "class C = A implements double;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_implementsDisallowedClass_classTypeAlias_int() { |
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "class C = A implements int;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_implementsDisallowedClass_classTypeAlias_Null() { |
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "class C = A implements Null;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_implementsDisallowedClass_classTypeAlias_num() { |
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "class C = A implements num;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_implementsDisallowedClass_classTypeAlias_String() { |
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "class C = A implements String;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_implementsDisallowedClass_classTypeAlias_String_num() { |
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "class C = A implements String, num;"])); |
+ resolve(source); |
+ assertErrors(source, [ |
+ CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, |
+ CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
void test_implementsDynamic() { |
Source source = addSource(EngineTestCase.createSource(["class A implements dynamic {}"])); |
resolve(source); |
@@ -12610,48 +12736,99 @@ class CompileTimeErrorCodeTest extends ResolverTestCase { |
verify([source]); |
} |
- void test_mixinOfDisallowedClass_bool() { |
+ void test_mixinOfDisallowedClass_class_bool() { |
Source source = addSource(EngineTestCase.createSource(["class A extends Object with bool {}"])); |
resolve(source); |
assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); |
verify([source]); |
} |
- void test_mixinOfDisallowedClass_double() { |
+ void test_mixinOfDisallowedClass_class_double() { |
Source source = addSource(EngineTestCase.createSource(["class A extends Object with double {}"])); |
resolve(source); |
assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); |
verify([source]); |
} |
- void test_mixinOfDisallowedClass_int() { |
+ void test_mixinOfDisallowedClass_class_int() { |
Source source = addSource(EngineTestCase.createSource(["class A extends Object with int {}"])); |
resolve(source); |
assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); |
verify([source]); |
} |
- void test_mixinOfDisallowedClass_Null() { |
+ void test_mixinOfDisallowedClass_class_Null() { |
Source source = addSource(EngineTestCase.createSource(["class A extends Object with Null {}"])); |
resolve(source); |
assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); |
verify([source]); |
} |
- void test_mixinOfDisallowedClass_num() { |
+ void test_mixinOfDisallowedClass_class_num() { |
Source source = addSource(EngineTestCase.createSource(["class A extends Object with num {}"])); |
resolve(source); |
assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); |
verify([source]); |
} |
- void test_mixinOfDisallowedClass_String() { |
+ void test_mixinOfDisallowedClass_class_String() { |
Source source = addSource(EngineTestCase.createSource(["class A extends Object with String {}"])); |
resolve(source); |
assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); |
verify([source]); |
} |
+ void test_mixinOfDisallowedClass_classTypeAlias_bool() { |
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "class C = A with bool;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_mixinOfDisallowedClass_classTypeAlias_double() { |
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "class C = A with double;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_mixinOfDisallowedClass_classTypeAlias_int() { |
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "class C = A with int;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_mixinOfDisallowedClass_classTypeAlias_Null() { |
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "class C = A with Null;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_mixinOfDisallowedClass_classTypeAlias_num() { |
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "class C = A with num;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_mixinOfDisallowedClass_classTypeAlias_String() { |
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "class C = A with String;"])); |
+ resolve(source); |
+ assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
+ void test_mixinOfDisallowedClass_classTypeAlias_String_num() { |
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "class C = A with String, num;"])); |
+ resolve(source); |
+ assertErrors(source, [ |
+ CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, |
+ CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); |
+ verify([source]); |
+ } |
+ |
void test_mixinOfNonClass_class() { |
Source source = addSource(EngineTestCase.createSource(["int A;", "class B extends Object with A {}"])); |
resolve(source); |
@@ -14249,29 +14426,53 @@ class CompileTimeErrorCodeTest extends ResolverTestCase { |
final __test = new CompileTimeErrorCodeTest(); |
runJUnitTest(__test, __test.test_exportOfNonLibrary); |
}); |
- _ut.test('test_extendsDisallowedClass_Null', () { |
+ _ut.test('test_extendsDisallowedClass_classTypeAlias_Null', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_extendsDisallowedClass_classTypeAlias_Null); |
+ }); |
+ _ut.test('test_extendsDisallowedClass_classTypeAlias_String', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_extendsDisallowedClass_classTypeAlias_String); |
+ }); |
+ _ut.test('test_extendsDisallowedClass_classTypeAlias_bool', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_extendsDisallowedClass_classTypeAlias_bool); |
+ }); |
+ _ut.test('test_extendsDisallowedClass_classTypeAlias_double', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_extendsDisallowedClass_Null); |
+ runJUnitTest(__test, __test.test_extendsDisallowedClass_classTypeAlias_double); |
}); |
- _ut.test('test_extendsDisallowedClass_String', () { |
+ _ut.test('test_extendsDisallowedClass_classTypeAlias_int', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_extendsDisallowedClass_String); |
+ runJUnitTest(__test, __test.test_extendsDisallowedClass_classTypeAlias_int); |
}); |
- _ut.test('test_extendsDisallowedClass_bool', () { |
+ _ut.test('test_extendsDisallowedClass_classTypeAlias_num', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_extendsDisallowedClass_bool); |
+ runJUnitTest(__test, __test.test_extendsDisallowedClass_classTypeAlias_num); |
}); |
- _ut.test('test_extendsDisallowedClass_double', () { |
+ _ut.test('test_extendsDisallowedClass_class_Null', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_extendsDisallowedClass_double); |
+ runJUnitTest(__test, __test.test_extendsDisallowedClass_class_Null); |
}); |
- _ut.test('test_extendsDisallowedClass_int', () { |
+ _ut.test('test_extendsDisallowedClass_class_String', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_extendsDisallowedClass_int); |
+ runJUnitTest(__test, __test.test_extendsDisallowedClass_class_String); |
}); |
- _ut.test('test_extendsDisallowedClass_num', () { |
+ _ut.test('test_extendsDisallowedClass_class_bool', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_extendsDisallowedClass_num); |
+ runJUnitTest(__test, __test.test_extendsDisallowedClass_class_bool); |
+ }); |
+ _ut.test('test_extendsDisallowedClass_class_double', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_extendsDisallowedClass_class_double); |
+ }); |
+ _ut.test('test_extendsDisallowedClass_class_int', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_extendsDisallowedClass_class_int); |
+ }); |
+ _ut.test('test_extendsDisallowedClass_class_num', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_extendsDisallowedClass_class_num); |
}); |
_ut.test('test_extendsNonClass_class', () { |
final __test = new CompileTimeErrorCodeTest(); |
@@ -14361,29 +14562,61 @@ class CompileTimeErrorCodeTest extends ResolverTestCase { |
final __test = new CompileTimeErrorCodeTest(); |
runJUnitTest(__test, __test.test_getterAndMethodWithSameName); |
}); |
- _ut.test('test_implementsDisallowedClass_Null', () { |
+ _ut.test('test_implementsDisallowedClass_classTypeAlias_Null', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_implementsDisallowedClass_classTypeAlias_Null); |
+ }); |
+ _ut.test('test_implementsDisallowedClass_classTypeAlias_String', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_implementsDisallowedClass_classTypeAlias_String); |
+ }); |
+ _ut.test('test_implementsDisallowedClass_classTypeAlias_String_num', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_implementsDisallowedClass_Null); |
+ runJUnitTest(__test, __test.test_implementsDisallowedClass_classTypeAlias_String_num); |
}); |
- _ut.test('test_implementsDisallowedClass_String', () { |
+ _ut.test('test_implementsDisallowedClass_classTypeAlias_bool', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_implementsDisallowedClass_String); |
+ runJUnitTest(__test, __test.test_implementsDisallowedClass_classTypeAlias_bool); |
}); |
- _ut.test('test_implementsDisallowedClass_bool', () { |
+ _ut.test('test_implementsDisallowedClass_classTypeAlias_double', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_implementsDisallowedClass_bool); |
+ runJUnitTest(__test, __test.test_implementsDisallowedClass_classTypeAlias_double); |
}); |
- _ut.test('test_implementsDisallowedClass_double', () { |
+ _ut.test('test_implementsDisallowedClass_classTypeAlias_int', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_implementsDisallowedClass_double); |
+ runJUnitTest(__test, __test.test_implementsDisallowedClass_classTypeAlias_int); |
}); |
- _ut.test('test_implementsDisallowedClass_int', () { |
+ _ut.test('test_implementsDisallowedClass_classTypeAlias_num', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_implementsDisallowedClass_int); |
+ runJUnitTest(__test, __test.test_implementsDisallowedClass_classTypeAlias_num); |
}); |
- _ut.test('test_implementsDisallowedClass_num', () { |
+ _ut.test('test_implementsDisallowedClass_class_Null', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_implementsDisallowedClass_num); |
+ runJUnitTest(__test, __test.test_implementsDisallowedClass_class_Null); |
+ }); |
+ _ut.test('test_implementsDisallowedClass_class_String', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_implementsDisallowedClass_class_String); |
+ }); |
+ _ut.test('test_implementsDisallowedClass_class_String_num', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_implementsDisallowedClass_class_String_num); |
+ }); |
+ _ut.test('test_implementsDisallowedClass_class_bool', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_implementsDisallowedClass_class_bool); |
+ }); |
+ _ut.test('test_implementsDisallowedClass_class_double', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_implementsDisallowedClass_class_double); |
+ }); |
+ _ut.test('test_implementsDisallowedClass_class_int', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_implementsDisallowedClass_class_int); |
+ }); |
+ _ut.test('test_implementsDisallowedClass_class_num', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_implementsDisallowedClass_class_num); |
}); |
_ut.test('test_implementsDynamic', () { |
final __test = new CompileTimeErrorCodeTest(); |
@@ -14673,29 +14906,57 @@ class CompileTimeErrorCodeTest extends ResolverTestCase { |
final __test = new CompileTimeErrorCodeTest(); |
runJUnitTest(__test, __test.test_mixinInheritsFromNotObject_typeAlias_with); |
}); |
- _ut.test('test_mixinOfDisallowedClass_Null', () { |
+ _ut.test('test_mixinOfDisallowedClass_classTypeAlias_Null', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_mixinOfDisallowedClass_classTypeAlias_Null); |
+ }); |
+ _ut.test('test_mixinOfDisallowedClass_classTypeAlias_String', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_mixinOfDisallowedClass_classTypeAlias_String); |
+ }); |
+ _ut.test('test_mixinOfDisallowedClass_classTypeAlias_String_num', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_mixinOfDisallowedClass_classTypeAlias_String_num); |
+ }); |
+ _ut.test('test_mixinOfDisallowedClass_classTypeAlias_bool', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_mixinOfDisallowedClass_classTypeAlias_bool); |
+ }); |
+ _ut.test('test_mixinOfDisallowedClass_classTypeAlias_double', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_mixinOfDisallowedClass_classTypeAlias_double); |
+ }); |
+ _ut.test('test_mixinOfDisallowedClass_classTypeAlias_int', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_mixinOfDisallowedClass_classTypeAlias_int); |
+ }); |
+ _ut.test('test_mixinOfDisallowedClass_classTypeAlias_num', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_mixinOfDisallowedClass_Null); |
+ runJUnitTest(__test, __test.test_mixinOfDisallowedClass_classTypeAlias_num); |
}); |
- _ut.test('test_mixinOfDisallowedClass_String', () { |
+ _ut.test('test_mixinOfDisallowedClass_class_Null', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_mixinOfDisallowedClass_String); |
+ runJUnitTest(__test, __test.test_mixinOfDisallowedClass_class_Null); |
}); |
- _ut.test('test_mixinOfDisallowedClass_bool', () { |
+ _ut.test('test_mixinOfDisallowedClass_class_String', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_mixinOfDisallowedClass_bool); |
+ runJUnitTest(__test, __test.test_mixinOfDisallowedClass_class_String); |
}); |
- _ut.test('test_mixinOfDisallowedClass_double', () { |
+ _ut.test('test_mixinOfDisallowedClass_class_bool', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_mixinOfDisallowedClass_double); |
+ runJUnitTest(__test, __test.test_mixinOfDisallowedClass_class_bool); |
}); |
- _ut.test('test_mixinOfDisallowedClass_int', () { |
+ _ut.test('test_mixinOfDisallowedClass_class_double', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_mixinOfDisallowedClass_int); |
+ runJUnitTest(__test, __test.test_mixinOfDisallowedClass_class_double); |
}); |
- _ut.test('test_mixinOfDisallowedClass_num', () { |
+ _ut.test('test_mixinOfDisallowedClass_class_int', () { |
final __test = new CompileTimeErrorCodeTest(); |
- runJUnitTest(__test, __test.test_mixinOfDisallowedClass_num); |
+ runJUnitTest(__test, __test.test_mixinOfDisallowedClass_class_int); |
+ }); |
+ _ut.test('test_mixinOfDisallowedClass_class_num', () { |
+ final __test = new CompileTimeErrorCodeTest(); |
+ runJUnitTest(__test, __test.test_mixinOfDisallowedClass_class_num); |
}); |
_ut.test('test_mixinOfNonClass_class', () { |
final __test = new CompileTimeErrorCodeTest(); |
@@ -19889,13 +20150,18 @@ class AnalysisContextHelper { |
*/ |
AnalysisContextHelper() { |
context = AnalysisContextFactory.contextWithCore(); |
+ AnalysisOptionsImpl options = new AnalysisOptionsImpl.con1(context.analysisOptions); |
+ options.cacheSize = 256; |
+ context.analysisOptions = options; |
} |
Source addSource(String path, String code) { |
Source source = new FileBasedSource.con1(FileUtilities2.createFile(path)); |
- ChangeSet changeSet = new ChangeSet(); |
- changeSet.addedSource(source); |
- context.applyChanges(changeSet); |
+ if (path.endsWith(".dart") || path.endsWith(".html")) { |
+ ChangeSet changeSet = new ChangeSet(); |
+ changeSet.addedSource(source); |
+ context.applyChanges(changeSet); |
+ } |
context.setContents(source, code); |
return source; |
} |
@@ -22945,6 +23211,21 @@ class NonHintCodeTest extends ResolverTestCase { |
verify([source]); |
} |
+ void test_unusedImport_metadata() { |
+ Source source = addSource(EngineTestCase.createSource([ |
+ "library L;", |
+ "@A(x)", |
+ "import 'lib1.dart';", |
+ "class A {", |
+ " final int value;", |
+ " const A(this.value);", |
+ "}"])); |
+ addNamedSource("/lib1.dart", EngineTestCase.createSource(["library lib1;", "const x = 0;"])); |
+ resolve(source); |
+ assertNoErrors(source); |
+ verify([source]); |
+ } |
+ |
void test_unusedImport_prefix_topLevelFunction() { |
Source source = addSource(EngineTestCase.createSource([ |
"library L;", |
@@ -23184,6 +23465,10 @@ class NonHintCodeTest extends ResolverTestCase { |
final __test = new NonHintCodeTest(); |
runJUnitTest(__test, __test.test_unusedImport_export_infiniteLoop); |
}); |
+ _ut.test('test_unusedImport_metadata', () { |
+ final __test = new NonHintCodeTest(); |
+ runJUnitTest(__test, __test.test_unusedImport_metadata); |
+ }); |
_ut.test('test_unusedImport_prefix_topLevelFunction', () { |
final __test = new NonHintCodeTest(); |
runJUnitTest(__test, __test.test_unusedImport_prefix_topLevelFunction); |
@@ -23416,7 +23701,7 @@ class LibraryElementBuilderTest extends EngineTestCase { |
*/ |
LibraryElement _buildLibrary(Source librarySource, List<ErrorCode> expectedErrorCodes) { |
LibraryResolver resolver = new LibraryResolver(_context); |
- LibraryElementBuilder builder = new LibraryElementBuilder(resolver); |
+ LibraryElementBuilder builder = new LibraryElementBuilder(resolver.analysisContext, resolver.errorListener); |
Library library = resolver.createLibrary(librarySource); |
LibraryElement element = builder.buildLibrary(library); |
GatheringErrorListener listener = new GatheringErrorListener(); |