| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 library engine.resolver_test; | 3 library engine.resolver_test; |
| 4 import 'package:analyzer_experimental/src/generated/java_core.dart'; | 4 import 'package:analyzer_experimental/src/generated/java_core.dart'; |
| 5 import 'package:analyzer_experimental/src/generated/java_junit.dart'; | 5 import 'package:analyzer_experimental/src/generated/java_junit.dart'; |
| 6 import 'package:analyzer_experimental/src/generated/source_io.dart'; | 6 import 'package:analyzer_experimental/src/generated/source_io.dart'; |
| 7 import 'package:analyzer_experimental/src/generated/error.dart'; | 7 import 'package:analyzer_experimental/src/generated/error.dart'; |
| 8 import 'package:analyzer_experimental/src/generated/scanner.dart'; | 8 import 'package:analyzer_experimental/src/generated/scanner.dart'; |
| 9 import 'package:analyzer_experimental/src/generated/ast.dart'; | 9 import 'package:analyzer_experimental/src/generated/ast.dart'; |
| 10 import 'package:analyzer_experimental/src/generated/parser.dart' show ParserErro
rCode; | 10 import 'package:analyzer_experimental/src/generated/parser.dart' show ParserErro
rCode; |
| (...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 " call() => 0;", | 940 " call() => 0;", |
| 941 " }", | 941 " }", |
| 942 "", | 942 "", |
| 943 " main() {", | 943 " main() {", |
| 944 " caller(new CallMeBack());", | 944 " caller(new CallMeBack());", |
| 945 " }"])); | 945 " }"])); |
| 946 resolve(source); | 946 resolve(source); |
| 947 assertNoErrors(source); | 947 assertNoErrors(source); |
| 948 verify([source]); | 948 verify([source]); |
| 949 } | 949 } |
| 950 void test_argumentTypeNotAssignable_fieldFormalParameterElement_member() { |
| 951 Source source = addSource(EngineTestCase.createSource([ |
| 952 "class ObjectSink<T> {", |
| 953 " void sink(T object) {", |
| 954 " new TimestampedObject<T>(object);", |
| 955 " }", |
| 956 "}", |
| 957 "class TimestampedObject<E> {", |
| 958 " E object2;", |
| 959 " TimestampedObject(this.object2);", |
| 960 "}"])); |
| 961 resolve(source); |
| 962 assertNoErrors(source); |
| 963 verify([source]); |
| 964 } |
| 950 void test_argumentTypeNotAssignable_invocation_functionParameter_generic() { | 965 void test_argumentTypeNotAssignable_invocation_functionParameter_generic() { |
| 951 Source source = addSource(EngineTestCase.createSource([ | 966 Source source = addSource(EngineTestCase.createSource([ |
| 952 "class A<K> {", | 967 "class A<K> {", |
| 953 " m(f(K k), K v) {", | 968 " m(f(K k), K v) {", |
| 954 " f(v);", | 969 " f(v);", |
| 955 " }", | 970 " }", |
| 956 "}"])); | 971 "}"])); |
| 957 resolve(source); | 972 resolve(source); |
| 958 assertNoErrors(source); | 973 assertNoErrors(source); |
| 959 verify([source]); | 974 verify([source]); |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1382 resolve(source); | 1397 resolve(source); |
| 1383 assertNoErrors(source); | 1398 assertNoErrors(source); |
| 1384 verify([source]); | 1399 verify([source]); |
| 1385 } | 1400 } |
| 1386 void test_dynamicIdentifier() { | 1401 void test_dynamicIdentifier() { |
| 1387 Source source = addSource(EngineTestCase.createSource(["main() {", " var v
= dynamic;", "}"])); | 1402 Source source = addSource(EngineTestCase.createSource(["main() {", " var v
= dynamic;", "}"])); |
| 1388 resolve(source); | 1403 resolve(source); |
| 1389 assertNoErrors(source); | 1404 assertNoErrors(source); |
| 1390 verify([source]); | 1405 verify([source]); |
| 1391 } | 1406 } |
| 1407 void test_expectedOneListTypeArgument() { |
| 1408 Source source = addSource(EngineTestCase.createSource(["main() {", " <int>
[];", "}"])); |
| 1409 resolve(source); |
| 1410 assertNoErrors(source); |
| 1411 verify([source]); |
| 1412 } |
| 1413 void test_expectedTwoMapTypeArguments() { |
| 1414 Source source = addSource(EngineTestCase.createSource(["main() {", " <int,
int> {};", "}"])); |
| 1415 resolve(source); |
| 1416 assertNoErrors(source); |
| 1417 verify([source]); |
| 1418 } |
| 1392 void test_exportOfNonLibrary_libraryDeclared() { | 1419 void test_exportOfNonLibrary_libraryDeclared() { |
| 1393 Source source = addSource(EngineTestCase.createSource(["library L;", "export
'lib1.dart';"])); | 1420 Source source = addSource(EngineTestCase.createSource(["library L;", "export
'lib1.dart';"])); |
| 1394 addSource2("/lib1.dart", EngineTestCase.createSource(["library lib1;"])); | 1421 addSource2("/lib1.dart", EngineTestCase.createSource(["library lib1;"])); |
| 1395 resolve(source); | 1422 resolve(source); |
| 1396 assertNoErrors(source); | 1423 assertNoErrors(source); |
| 1397 verify([source]); | 1424 verify([source]); |
| 1398 } | 1425 } |
| 1399 void test_exportOfNonLibrary_libraryNotDeclared() { | 1426 void test_exportOfNonLibrary_libraryNotDeclared() { |
| 1400 Source source = addSource(EngineTestCase.createSource(["library L;", "export
'lib1.dart';"])); | 1427 Source source = addSource(EngineTestCase.createSource(["library L;", "export
'lib1.dart';"])); |
| 1401 addSource2("/lib1.dart", EngineTestCase.createSource([""])); | 1428 addSource2("/lib1.dart", EngineTestCase.createSource([""])); |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2035 resolve(source); | 2062 resolve(source); |
| 2036 assertNoErrors(source); | 2063 assertNoErrors(source); |
| 2037 verify([source]); | 2064 verify([source]); |
| 2038 } | 2065 } |
| 2039 void test_invalidOverrideRequired_less() { | 2066 void test_invalidOverrideRequired_less() { |
| 2040 Source source = addSource(EngineTestCase.createSource([ | 2067 Source source = addSource(EngineTestCase.createSource([ |
| 2041 "class A {", | 2068 "class A {", |
| 2042 " m(a, b) {}", | 2069 " m(a, b) {}", |
| 2043 "}", | 2070 "}", |
| 2044 "class B extends A {", | 2071 "class B extends A {", |
| 2045 " m(a) {}", | 2072 " m(a, [b]) {}", |
| 2046 "}"])); | 2073 "}"])); |
| 2047 resolve(source); | 2074 resolve(source); |
| 2048 assertNoErrors(source); | 2075 assertNoErrors(source); |
| 2049 verify([source]); | 2076 verify([source]); |
| 2050 } | 2077 } |
| 2051 void test_invalidOverrideRequired_same() { | 2078 void test_invalidOverrideRequired_same() { |
| 2052 Source source = addSource(EngineTestCase.createSource([ | 2079 Source source = addSource(EngineTestCase.createSource([ |
| 2053 "class A {", | 2080 "class A {", |
| 2054 " m(a) {}", | 2081 " m(a) {}", |
| 2055 "}", | 2082 "}", |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2343 void test_mixinDeclaresConstructor_factory() { | 2370 void test_mixinDeclaresConstructor_factory() { |
| 2344 Source source = addSource(EngineTestCase.createSource([ | 2371 Source source = addSource(EngineTestCase.createSource([ |
| 2345 "class A {", | 2372 "class A {", |
| 2346 " factory A() {}", | 2373 " factory A() {}", |
| 2347 "}", | 2374 "}", |
| 2348 "class B extends Object with A {}"])); | 2375 "class B extends Object with A {}"])); |
| 2349 resolve(source); | 2376 resolve(source); |
| 2350 assertNoErrors(source); | 2377 assertNoErrors(source); |
| 2351 verify([source]); | 2378 verify([source]); |
| 2352 } | 2379 } |
| 2353 void test_mixinInheritsFromNotObject_classDeclaration_mixTypedef() { | 2380 void test_mixinInheritsFromNotObject_classDeclaration_mixTypeAlias() { |
| 2354 Source source = addSource(EngineTestCase.createSource([ | 2381 Source source = addSource(EngineTestCase.createSource([ |
| 2355 "class A {}", | 2382 "class A {}", |
| 2356 "typedef B = Object with A;", | 2383 "class B = Object with A;", |
| 2357 "class C extends Object with B {}"])); | 2384 "class C extends Object with B {}"])); |
| 2358 resolve(source); | 2385 resolve(source); |
| 2359 assertNoErrors(source); | 2386 assertNoErrors(source); |
| 2360 verify([source]); | 2387 verify([source]); |
| 2361 } | 2388 } |
| 2362 void test_mixinInheritsFromNotObject_typedef_mixTypedef() { | 2389 void test_mixinInheritsFromNotObject_typedef_mixTypeAlias() { |
| 2363 Source source = addSource(EngineTestCase.createSource([ | 2390 Source source = addSource(EngineTestCase.createSource([ |
| 2364 "class A {}", | 2391 "class A {}", |
| 2365 "typedef B = Object with A;", | 2392 "class B = Object with A;", |
| 2366 "typedef C = Object with B;"])); | 2393 "class C = Object with B;"])); |
| 2367 resolve(source); | 2394 resolve(source); |
| 2368 assertNoErrors(source); | 2395 assertNoErrors(source); |
| 2369 verify([source]); | 2396 verify([source]); |
| 2370 } | 2397 } |
| 2371 void test_multipleSuperInitializers_no() { | 2398 void test_multipleSuperInitializers_no() { |
| 2372 Source source = addSource(EngineTestCase.createSource(["class A {}", "class
B extends A {", " B() {}", "}"])); | 2399 Source source = addSource(EngineTestCase.createSource(["class A {}", "class
B extends A {", " B() {}", "}"])); |
| 2373 resolve(source); | 2400 resolve(source); |
| 2374 assertNoErrors(source); | 2401 assertNoErrors(source); |
| 2375 verify([source]); | 2402 verify([source]); |
| 2376 } | 2403 } |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2794 "import 'lib.dart' as p;", | 2821 "import 'lib.dart' as p;", |
| 2795 "typedef P();", | 2822 "typedef P();", |
| 2796 "p2() {}", | 2823 "p2() {}", |
| 2797 "var p3;", | 2824 "var p3;", |
| 2798 "class p4 {}", | 2825 "class p4 {}", |
| 2799 "p.A a;"])); | 2826 "p.A a;"])); |
| 2800 resolve(source); | 2827 resolve(source); |
| 2801 assertNoErrors(source); | 2828 assertNoErrors(source); |
| 2802 verify([source]); | 2829 verify([source]); |
| 2803 } | 2830 } |
| 2831 void test_propagateTypeArgsIntoBounds() { |
| 2832 Source source = addSource(EngineTestCase.createSource([ |
| 2833 "abstract class A<E> {}", |
| 2834 "abstract class B<F> implements A<F>{}", |
| 2835 "abstract class C<G, H extends A<G>> {}", |
| 2836 "class D<I> extends C<I, B<I>> {}"])); |
| 2837 resolve(source); |
| 2838 assertNoErrors(source); |
| 2839 verify([source]); |
| 2840 } |
| 2804 void test_proxy_annotation_prefixed() { | 2841 void test_proxy_annotation_prefixed() { |
| 2805 Source source = addSource(EngineTestCase.createSource([ | 2842 Source source = addSource(EngineTestCase.createSource([ |
| 2806 "library L;", | 2843 "library L;", |
| 2807 "import 'meta.dart';", | 2844 "import 'meta.dart';", |
| 2808 "@proxy", | 2845 "@proxy", |
| 2809 "class A {}", | 2846 "class A {}", |
| 2810 "f(A a) {", | 2847 "f(A a) {", |
| 2811 " a.m();", | 2848 " a.m();", |
| 2812 " var x = a.g;", | 2849 " var x = a.g;", |
| 2813 " a.s = 1;", | 2850 " a.s = 1;", |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2919 "class A implements B {", | 2956 "class A implements B {", |
| 2920 " A(int p) {}", | 2957 " A(int p) {}", |
| 2921 "}", | 2958 "}", |
| 2922 "class B {", | 2959 "class B {", |
| 2923 " factory B(int p) = A;", | 2960 " factory B(int p) = A;", |
| 2924 "}"])); | 2961 "}"])); |
| 2925 resolve(source); | 2962 resolve(source); |
| 2926 assertNoErrors(source); | 2963 assertNoErrors(source); |
| 2927 verify([source]); | 2964 verify([source]); |
| 2928 } | 2965 } |
| 2966 void test_redirectToInvalidReturnType() { |
| 2967 Source source = addSource(EngineTestCase.createSource([ |
| 2968 "class A {", |
| 2969 " A() {}", |
| 2970 "}", |
| 2971 "class B extends A {", |
| 2972 " factory B() = A;", |
| 2973 "}"])); |
| 2974 resolve(source); |
| 2975 assertNoErrors(source); |
| 2976 verify([source]); |
| 2977 } |
| 2929 void test_redirectToNonConstConstructor() { | 2978 void test_redirectToNonConstConstructor() { |
| 2930 Source source = addSource(EngineTestCase.createSource([ | 2979 Source source = addSource(EngineTestCase.createSource([ |
| 2931 "class A {", | 2980 "class A {", |
| 2932 " const A.a();", | 2981 " const A.a();", |
| 2933 " const factory A.b() = A.a;", | 2982 " const factory A.b() = A.a;", |
| 2934 "}"])); | 2983 "}"])); |
| 2935 resolve(source); | 2984 resolve(source); |
| 2936 assertNoErrors(source); | 2985 assertNoErrors(source); |
| 2937 verify([source]); | 2986 verify([source]); |
| 2938 } | 2987 } |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3224 "class A {", | 3273 "class A {", |
| 3225 " A() {}", | 3274 " A() {}", |
| 3226 "}", | 3275 "}", |
| 3227 "class B extends A {", | 3276 "class B extends A {", |
| 3228 " B();", | 3277 " B();", |
| 3229 "}"])); | 3278 "}"])); |
| 3230 resolve(source); | 3279 resolve(source); |
| 3231 assertNoErrors(source); | 3280 assertNoErrors(source); |
| 3232 verify([source]); | 3281 verify([source]); |
| 3233 } | 3282 } |
| 3234 void test_undefinedConstructorInInitializer_implicit_typedef() { | 3283 void test_undefinedConstructorInInitializer_implicit_typeAlias() { |
| 3235 Source source = addSource(EngineTestCase.createSource([ | 3284 Source source = addSource(EngineTestCase.createSource([ |
| 3236 "class M {}", | 3285 "class M {}", |
| 3237 "typedef A = Object with M;", | 3286 "class A = Object with M;", |
| 3238 "class B extends A {", | 3287 "class B extends A {", |
| 3239 " B();", | 3288 " B();", |
| 3240 "}"])); | 3289 "}"])); |
| 3241 resolve(source); | 3290 resolve(source); |
| 3242 assertNoErrors(source); | 3291 assertNoErrors(source); |
| 3243 verify([source]); | 3292 verify([source]); |
| 3244 } | 3293 } |
| 3245 void test_undefinedConstructorInInitializer_redirecting() { | 3294 void test_undefinedConstructorInInitializer_redirecting() { |
| 3246 Source source = addSource(EngineTestCase.createSource([ | 3295 Source source = addSource(EngineTestCase.createSource([ |
| 3247 "class Foo {", | 3296 "class Foo {", |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3418 runJUnitTest(__test, __test.test_argumentDefinitionTestNonParameter_opti
onalParameter); | 3467 runJUnitTest(__test, __test.test_argumentDefinitionTestNonParameter_opti
onalParameter); |
| 3419 }); | 3468 }); |
| 3420 _ut.test('test_argumentTypeNotAssignable_Object_Function', () { | 3469 _ut.test('test_argumentTypeNotAssignable_Object_Function', () { |
| 3421 final __test = new NonErrorResolverTest(); | 3470 final __test = new NonErrorResolverTest(); |
| 3422 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_Object_Functi
on); | 3471 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_Object_Functi
on); |
| 3423 }); | 3472 }); |
| 3424 _ut.test('test_argumentTypeNotAssignable_classWithCall_Function', () { | 3473 _ut.test('test_argumentTypeNotAssignable_classWithCall_Function', () { |
| 3425 final __test = new NonErrorResolverTest(); | 3474 final __test = new NonErrorResolverTest(); |
| 3426 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_classWithCall
_Function); | 3475 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_classWithCall
_Function); |
| 3427 }); | 3476 }); |
| 3477 _ut.test('test_argumentTypeNotAssignable_fieldFormalParameterElement_membe
r', () { |
| 3478 final __test = new NonErrorResolverTest(); |
| 3479 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_fieldFormalPa
rameterElement_member); |
| 3480 }); |
| 3428 _ut.test('test_argumentTypeNotAssignable_invocation_functionParameter_gene
ric', () { | 3481 _ut.test('test_argumentTypeNotAssignable_invocation_functionParameter_gene
ric', () { |
| 3429 final __test = new NonErrorResolverTest(); | 3482 final __test = new NonErrorResolverTest(); |
| 3430 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_invocation_fu
nctionParameter_generic); | 3483 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_invocation_fu
nctionParameter_generic); |
| 3431 }); | 3484 }); |
| 3432 _ut.test('test_argumentTypeNotAssignable_invocation_typedef_generic', () { | 3485 _ut.test('test_argumentTypeNotAssignable_invocation_typedef_generic', () { |
| 3433 final __test = new NonErrorResolverTest(); | 3486 final __test = new NonErrorResolverTest(); |
| 3434 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_invocation_ty
pedef_generic); | 3487 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_invocation_ty
pedef_generic); |
| 3435 }); | 3488 }); |
| 3436 _ut.test('test_argumentTypeNotAssignable_typedef_local', () { | 3489 _ut.test('test_argumentTypeNotAssignable_typedef_local', () { |
| 3437 final __test = new NonErrorResolverTest(); | 3490 final __test = new NonErrorResolverTest(); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3578 runJUnitTest(__test, __test.test_duplicateDefinition_emptyName); | 3631 runJUnitTest(__test, __test.test_duplicateDefinition_emptyName); |
| 3579 }); | 3632 }); |
| 3580 _ut.test('test_duplicateDefinition_getter', () { | 3633 _ut.test('test_duplicateDefinition_getter', () { |
| 3581 final __test = new NonErrorResolverTest(); | 3634 final __test = new NonErrorResolverTest(); |
| 3582 runJUnitTest(__test, __test.test_duplicateDefinition_getter); | 3635 runJUnitTest(__test, __test.test_duplicateDefinition_getter); |
| 3583 }); | 3636 }); |
| 3584 _ut.test('test_dynamicIdentifier', () { | 3637 _ut.test('test_dynamicIdentifier', () { |
| 3585 final __test = new NonErrorResolverTest(); | 3638 final __test = new NonErrorResolverTest(); |
| 3586 runJUnitTest(__test, __test.test_dynamicIdentifier); | 3639 runJUnitTest(__test, __test.test_dynamicIdentifier); |
| 3587 }); | 3640 }); |
| 3641 _ut.test('test_expectedOneListTypeArgument', () { |
| 3642 final __test = new NonErrorResolverTest(); |
| 3643 runJUnitTest(__test, __test.test_expectedOneListTypeArgument); |
| 3644 }); |
| 3645 _ut.test('test_expectedTwoMapTypeArguments', () { |
| 3646 final __test = new NonErrorResolverTest(); |
| 3647 runJUnitTest(__test, __test.test_expectedTwoMapTypeArguments); |
| 3648 }); |
| 3588 _ut.test('test_exportOfNonLibrary_libraryDeclared', () { | 3649 _ut.test('test_exportOfNonLibrary_libraryDeclared', () { |
| 3589 final __test = new NonErrorResolverTest(); | 3650 final __test = new NonErrorResolverTest(); |
| 3590 runJUnitTest(__test, __test.test_exportOfNonLibrary_libraryDeclared); | 3651 runJUnitTest(__test, __test.test_exportOfNonLibrary_libraryDeclared); |
| 3591 }); | 3652 }); |
| 3592 _ut.test('test_exportOfNonLibrary_libraryNotDeclared', () { | 3653 _ut.test('test_exportOfNonLibrary_libraryNotDeclared', () { |
| 3593 final __test = new NonErrorResolverTest(); | 3654 final __test = new NonErrorResolverTest(); |
| 3594 runJUnitTest(__test, __test.test_exportOfNonLibrary_libraryNotDeclared); | 3655 runJUnitTest(__test, __test.test_exportOfNonLibrary_libraryNotDeclared); |
| 3595 }); | 3656 }); |
| 3596 _ut.test('test_extraPositionalArguments_Function', () { | 3657 _ut.test('test_extraPositionalArguments_Function', () { |
| 3597 final __test = new NonErrorResolverTest(); | 3658 final __test = new NonErrorResolverTest(); |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3978 runJUnitTest(__test, __test.test_misMatchedGetterAndSetterTypes_topLevel
_unspecifiedSetter); | 4039 runJUnitTest(__test, __test.test_misMatchedGetterAndSetterTypes_topLevel
_unspecifiedSetter); |
| 3979 }); | 4040 }); |
| 3980 _ut.test('test_mixinDeclaresConstructor', () { | 4041 _ut.test('test_mixinDeclaresConstructor', () { |
| 3981 final __test = new NonErrorResolverTest(); | 4042 final __test = new NonErrorResolverTest(); |
| 3982 runJUnitTest(__test, __test.test_mixinDeclaresConstructor); | 4043 runJUnitTest(__test, __test.test_mixinDeclaresConstructor); |
| 3983 }); | 4044 }); |
| 3984 _ut.test('test_mixinDeclaresConstructor_factory', () { | 4045 _ut.test('test_mixinDeclaresConstructor_factory', () { |
| 3985 final __test = new NonErrorResolverTest(); | 4046 final __test = new NonErrorResolverTest(); |
| 3986 runJUnitTest(__test, __test.test_mixinDeclaresConstructor_factory); | 4047 runJUnitTest(__test, __test.test_mixinDeclaresConstructor_factory); |
| 3987 }); | 4048 }); |
| 3988 _ut.test('test_mixinInheritsFromNotObject_classDeclaration_mixTypedef', ()
{ | 4049 _ut.test('test_mixinInheritsFromNotObject_classDeclaration_mixTypeAlias',
() { |
| 3989 final __test = new NonErrorResolverTest(); | 4050 final __test = new NonErrorResolverTest(); |
| 3990 runJUnitTest(__test, __test.test_mixinInheritsFromNotObject_classDeclara
tion_mixTypedef); | 4051 runJUnitTest(__test, __test.test_mixinInheritsFromNotObject_classDeclara
tion_mixTypeAlias); |
| 3991 }); | 4052 }); |
| 3992 _ut.test('test_mixinInheritsFromNotObject_typedef_mixTypedef', () { | 4053 _ut.test('test_mixinInheritsFromNotObject_typedef_mixTypeAlias', () { |
| 3993 final __test = new NonErrorResolverTest(); | 4054 final __test = new NonErrorResolverTest(); |
| 3994 runJUnitTest(__test, __test.test_mixinInheritsFromNotObject_typedef_mixT
ypedef); | 4055 runJUnitTest(__test, __test.test_mixinInheritsFromNotObject_typedef_mixT
ypeAlias); |
| 3995 }); | 4056 }); |
| 3996 _ut.test('test_multipleSuperInitializers_no', () { | 4057 _ut.test('test_multipleSuperInitializers_no', () { |
| 3997 final __test = new NonErrorResolverTest(); | 4058 final __test = new NonErrorResolverTest(); |
| 3998 runJUnitTest(__test, __test.test_multipleSuperInitializers_no); | 4059 runJUnitTest(__test, __test.test_multipleSuperInitializers_no); |
| 3999 }); | 4060 }); |
| 4000 _ut.test('test_multipleSuperInitializers_single', () { | 4061 _ut.test('test_multipleSuperInitializers_single', () { |
| 4001 final __test = new NonErrorResolverTest(); | 4062 final __test = new NonErrorResolverTest(); |
| 4002 runJUnitTest(__test, __test.test_multipleSuperInitializers_single); | 4063 runJUnitTest(__test, __test.test_multipleSuperInitializers_single); |
| 4003 }); | 4064 }); |
| 4004 _ut.test('test_newWithAbstractClass_factory', () { | 4065 _ut.test('test_newWithAbstractClass_factory', () { |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4158 runJUnitTest(__test, __test.test_null_callOperator); | 4219 runJUnitTest(__test, __test.test_null_callOperator); |
| 4159 }); | 4220 }); |
| 4160 _ut.test('test_optionalParameterInOperator_required', () { | 4221 _ut.test('test_optionalParameterInOperator_required', () { |
| 4161 final __test = new NonErrorResolverTest(); | 4222 final __test = new NonErrorResolverTest(); |
| 4162 runJUnitTest(__test, __test.test_optionalParameterInOperator_required); | 4223 runJUnitTest(__test, __test.test_optionalParameterInOperator_required); |
| 4163 }); | 4224 }); |
| 4164 _ut.test('test_prefixCollidesWithTopLevelMembers', () { | 4225 _ut.test('test_prefixCollidesWithTopLevelMembers', () { |
| 4165 final __test = new NonErrorResolverTest(); | 4226 final __test = new NonErrorResolverTest(); |
| 4166 runJUnitTest(__test, __test.test_prefixCollidesWithTopLevelMembers); | 4227 runJUnitTest(__test, __test.test_prefixCollidesWithTopLevelMembers); |
| 4167 }); | 4228 }); |
| 4229 _ut.test('test_propagateTypeArgsIntoBounds', () { |
| 4230 final __test = new NonErrorResolverTest(); |
| 4231 runJUnitTest(__test, __test.test_propagateTypeArgsIntoBounds); |
| 4232 }); |
| 4168 _ut.test('test_proxy_annotation_prefixed', () { | 4233 _ut.test('test_proxy_annotation_prefixed', () { |
| 4169 final __test = new NonErrorResolverTest(); | 4234 final __test = new NonErrorResolverTest(); |
| 4170 runJUnitTest(__test, __test.test_proxy_annotation_prefixed); | 4235 runJUnitTest(__test, __test.test_proxy_annotation_prefixed); |
| 4171 }); | 4236 }); |
| 4172 _ut.test('test_proxy_annotation_prefixed2', () { | 4237 _ut.test('test_proxy_annotation_prefixed2', () { |
| 4173 final __test = new NonErrorResolverTest(); | 4238 final __test = new NonErrorResolverTest(); |
| 4174 runJUnitTest(__test, __test.test_proxy_annotation_prefixed2); | 4239 runJUnitTest(__test, __test.test_proxy_annotation_prefixed2); |
| 4175 }); | 4240 }); |
| 4176 _ut.test('test_proxy_annotation_prefixed3', () { | 4241 _ut.test('test_proxy_annotation_prefixed3', () { |
| 4177 final __test = new NonErrorResolverTest(); | 4242 final __test = new NonErrorResolverTest(); |
| 4178 runJUnitTest(__test, __test.test_proxy_annotation_prefixed3); | 4243 runJUnitTest(__test, __test.test_proxy_annotation_prefixed3); |
| 4179 }); | 4244 }); |
| 4180 _ut.test('test_proxy_annotation_simple', () { | 4245 _ut.test('test_proxy_annotation_simple', () { |
| 4181 final __test = new NonErrorResolverTest(); | 4246 final __test = new NonErrorResolverTest(); |
| 4182 runJUnitTest(__test, __test.test_proxy_annotation_simple); | 4247 runJUnitTest(__test, __test.test_proxy_annotation_simple); |
| 4183 }); | 4248 }); |
| 4184 _ut.test('test_recursiveConstructorRedirect', () { | 4249 _ut.test('test_recursiveConstructorRedirect', () { |
| 4185 final __test = new NonErrorResolverTest(); | 4250 final __test = new NonErrorResolverTest(); |
| 4186 runJUnitTest(__test, __test.test_recursiveConstructorRedirect); | 4251 runJUnitTest(__test, __test.test_recursiveConstructorRedirect); |
| 4187 }); | 4252 }); |
| 4188 _ut.test('test_recursiveFactoryRedirect', () { | 4253 _ut.test('test_recursiveFactoryRedirect', () { |
| 4189 final __test = new NonErrorResolverTest(); | 4254 final __test = new NonErrorResolverTest(); |
| 4190 runJUnitTest(__test, __test.test_recursiveFactoryRedirect); | 4255 runJUnitTest(__test, __test.test_recursiveFactoryRedirect); |
| 4191 }); | 4256 }); |
| 4192 _ut.test('test_redirectToInvalidFunctionType', () { | 4257 _ut.test('test_redirectToInvalidFunctionType', () { |
| 4193 final __test = new NonErrorResolverTest(); | 4258 final __test = new NonErrorResolverTest(); |
| 4194 runJUnitTest(__test, __test.test_redirectToInvalidFunctionType); | 4259 runJUnitTest(__test, __test.test_redirectToInvalidFunctionType); |
| 4195 }); | 4260 }); |
| 4261 _ut.test('test_redirectToInvalidReturnType', () { |
| 4262 final __test = new NonErrorResolverTest(); |
| 4263 runJUnitTest(__test, __test.test_redirectToInvalidReturnType); |
| 4264 }); |
| 4196 _ut.test('test_redirectToNonConstConstructor', () { | 4265 _ut.test('test_redirectToNonConstConstructor', () { |
| 4197 final __test = new NonErrorResolverTest(); | 4266 final __test = new NonErrorResolverTest(); |
| 4198 runJUnitTest(__test, __test.test_redirectToNonConstConstructor); | 4267 runJUnitTest(__test, __test.test_redirectToNonConstConstructor); |
| 4199 }); | 4268 }); |
| 4200 _ut.test('test_referenceToDeclaredVariableInInitializer_constructorName',
() { | 4269 _ut.test('test_referenceToDeclaredVariableInInitializer_constructorName',
() { |
| 4201 final __test = new NonErrorResolverTest(); | 4270 final __test = new NonErrorResolverTest(); |
| 4202 runJUnitTest(__test, __test.test_referenceToDeclaredVariableInInitialize
r_constructorName); | 4271 runJUnitTest(__test, __test.test_referenceToDeclaredVariableInInitialize
r_constructorName); |
| 4203 }); | 4272 }); |
| 4204 _ut.test('test_referenceToDeclaredVariableInInitializer_methodName', () { | 4273 _ut.test('test_referenceToDeclaredVariableInInitializer_methodName', () { |
| 4205 final __test = new NonErrorResolverTest(); | 4274 final __test = new NonErrorResolverTest(); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4302 runJUnitTest(__test, __test.test_undefinedConstructorInInitializer_expli
cit_unnamed); | 4371 runJUnitTest(__test, __test.test_undefinedConstructorInInitializer_expli
cit_unnamed); |
| 4303 }); | 4372 }); |
| 4304 _ut.test('test_undefinedConstructorInInitializer_hasOptionalParameters', (
) { | 4373 _ut.test('test_undefinedConstructorInInitializer_hasOptionalParameters', (
) { |
| 4305 final __test = new NonErrorResolverTest(); | 4374 final __test = new NonErrorResolverTest(); |
| 4306 runJUnitTest(__test, __test.test_undefinedConstructorInInitializer_hasOp
tionalParameters); | 4375 runJUnitTest(__test, __test.test_undefinedConstructorInInitializer_hasOp
tionalParameters); |
| 4307 }); | 4376 }); |
| 4308 _ut.test('test_undefinedConstructorInInitializer_implicit', () { | 4377 _ut.test('test_undefinedConstructorInInitializer_implicit', () { |
| 4309 final __test = new NonErrorResolverTest(); | 4378 final __test = new NonErrorResolverTest(); |
| 4310 runJUnitTest(__test, __test.test_undefinedConstructorInInitializer_impli
cit); | 4379 runJUnitTest(__test, __test.test_undefinedConstructorInInitializer_impli
cit); |
| 4311 }); | 4380 }); |
| 4312 _ut.test('test_undefinedConstructorInInitializer_implicit_typedef', () { | 4381 _ut.test('test_undefinedConstructorInInitializer_implicit_typeAlias', () { |
| 4313 final __test = new NonErrorResolverTest(); | 4382 final __test = new NonErrorResolverTest(); |
| 4314 runJUnitTest(__test, __test.test_undefinedConstructorInInitializer_impli
cit_typedef); | 4383 runJUnitTest(__test, __test.test_undefinedConstructorInInitializer_impli
cit_typeAlias); |
| 4315 }); | 4384 }); |
| 4316 _ut.test('test_undefinedConstructorInInitializer_redirecting', () { | 4385 _ut.test('test_undefinedConstructorInInitializer_redirecting', () { |
| 4317 final __test = new NonErrorResolverTest(); | 4386 final __test = new NonErrorResolverTest(); |
| 4318 runJUnitTest(__test, __test.test_undefinedConstructorInInitializer_redir
ecting); | 4387 runJUnitTest(__test, __test.test_undefinedConstructorInInitializer_redir
ecting); |
| 4319 }); | 4388 }); |
| 4320 _ut.test('test_undefinedGetter_typeSubstitution', () { | 4389 _ut.test('test_undefinedGetter_typeSubstitution', () { |
| 4321 final __test = new NonErrorResolverTest(); | 4390 final __test = new NonErrorResolverTest(); |
| 4322 runJUnitTest(__test, __test.test_undefinedGetter_typeSubstitution); | 4391 runJUnitTest(__test, __test.test_undefinedGetter_typeSubstitution); |
| 4323 }); | 4392 }); |
| 4324 _ut.test('test_undefinedIdentifier_hide', () { | 4393 _ut.test('test_undefinedIdentifier_hide', () { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4504 }); | 4573 }); |
| 4505 } | 4574 } |
| 4506 } | 4575 } |
| 4507 class StaticTypeWarningCodeTest extends ResolverTestCase { | 4576 class StaticTypeWarningCodeTest extends ResolverTestCase { |
| 4508 void fail_inaccessibleSetter() { | 4577 void fail_inaccessibleSetter() { |
| 4509 Source source = addSource(EngineTestCase.createSource([])); | 4578 Source source = addSource(EngineTestCase.createSource([])); |
| 4510 resolve(source); | 4579 resolve(source); |
| 4511 assertErrors(source, [StaticTypeWarningCode.INACCESSIBLE_SETTER]); | 4580 assertErrors(source, [StaticTypeWarningCode.INACCESSIBLE_SETTER]); |
| 4512 verify([source]); | 4581 verify([source]); |
| 4513 } | 4582 } |
| 4583 void test_expectedOneListTypeArgument() { |
| 4584 Source source = addSource(EngineTestCase.createSource(["main() {", " <int,
int> [];", "}"])); |
| 4585 resolve(source); |
| 4586 assertErrors(source, [StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS
]); |
| 4587 verify([source]); |
| 4588 } |
| 4589 void test_expectedTwoMapTypeArguments_one() { |
| 4590 Source source = addSource(EngineTestCase.createSource(["main() {", " <int>
{};", "}"])); |
| 4591 resolve(source); |
| 4592 assertErrors(source, [StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS]
); |
| 4593 verify([source]); |
| 4594 } |
| 4595 void test_expectedTwoMapTypeArguments_three() { |
| 4596 Source source = addSource(EngineTestCase.createSource(["main() {", " <int,
int, int> {};", "}"])); |
| 4597 resolve(source); |
| 4598 assertErrors(source, [StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS]
); |
| 4599 verify([source]); |
| 4600 } |
| 4514 void test_inconsistentMethodInheritance_paramCount() { | 4601 void test_inconsistentMethodInheritance_paramCount() { |
| 4515 Source source = addSource(EngineTestCase.createSource([ | 4602 Source source = addSource(EngineTestCase.createSource([ |
| 4516 "abstract class A {", | 4603 "abstract class A {", |
| 4517 " int x();", | 4604 " int x();", |
| 4518 "}", | 4605 "}", |
| 4519 "abstract class B {", | 4606 "abstract class B {", |
| 4520 " int x(int y);", | 4607 " int x(int y);", |
| 4521 "}", | 4608 "}", |
| 4522 "class C implements A, B {", | 4609 "class C implements A, B {", |
| 4523 "}"])); | 4610 "}"])); |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4858 resolve(source); | 4945 resolve(source); |
| 4859 assertErrors(source, [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]); | 4946 assertErrors(source, [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]); |
| 4860 verify([source]); | 4947 verify([source]); |
| 4861 } | 4948 } |
| 4862 void test_typeArgumentNotMatchingBounds_classTypeAlias() { | 4949 void test_typeArgumentNotMatchingBounds_classTypeAlias() { |
| 4863 Source source = addSource(EngineTestCase.createSource([ | 4950 Source source = addSource(EngineTestCase.createSource([ |
| 4864 "class A {}", | 4951 "class A {}", |
| 4865 "class B {}", | 4952 "class B {}", |
| 4866 "class C {}", | 4953 "class C {}", |
| 4867 "class G<E extends A> {}", | 4954 "class G<E extends A> {}", |
| 4868 "typedef D = G<B> with C;"])); | 4955 "class D = G<B> with C;"])); |
| 4869 resolve(source); | 4956 resolve(source); |
| 4870 assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUND
S]); | 4957 assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUND
S]); |
| 4871 verify([source]); | 4958 verify([source]); |
| 4872 } | 4959 } |
| 4873 void test_typeArgumentNotMatchingBounds_extends() { | 4960 void test_typeArgumentNotMatchingBounds_extends() { |
| 4874 Source source = addSource(EngineTestCase.createSource([ | 4961 Source source = addSource(EngineTestCase.createSource([ |
| 4875 "class A {}", | 4962 "class A {}", |
| 4876 "class B {}", | 4963 "class B {}", |
| 4877 "class G<E extends A> {}", | 4964 "class G<E extends A> {}", |
| 4878 "class C extends G<B>{}"])); | 4965 "class C extends G<B>{}"])); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5033 void test_typeArgumentNotMatchingBounds_with() { | 5120 void test_typeArgumentNotMatchingBounds_with() { |
| 5034 Source source = addSource(EngineTestCase.createSource([ | 5121 Source source = addSource(EngineTestCase.createSource([ |
| 5035 "class A {}", | 5122 "class A {}", |
| 5036 "class B {}", | 5123 "class B {}", |
| 5037 "class G<E extends A> {}", | 5124 "class G<E extends A> {}", |
| 5038 "class C extends Object with G<B>{}"])); | 5125 "class C extends Object with G<B>{}"])); |
| 5039 resolve(source); | 5126 resolve(source); |
| 5040 assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUND
S]); | 5127 assertErrors(source, [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUND
S]); |
| 5041 verify([source]); | 5128 verify([source]); |
| 5042 } | 5129 } |
| 5130 void test_typeParameterSupertypeOfItsBound() { |
| 5131 Source source = addSource(EngineTestCase.createSource(["class A<T extends T>
{", "}"])); |
| 5132 resolve(source); |
| 5133 assertErrors(source, [StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_
BOUND]); |
| 5134 verify([source]); |
| 5135 } |
| 5043 void test_undefinedGetter() { | 5136 void test_undefinedGetter() { |
| 5044 Source source = addSource(EngineTestCase.createSource(["class T {}", "f(T e)
{ return e.m; }"])); | 5137 Source source = addSource(EngineTestCase.createSource(["class T {}", "f(T e)
{ return e.m; }"])); |
| 5045 resolve(source); | 5138 resolve(source); |
| 5046 assertErrors(source, [StaticTypeWarningCode.UNDEFINED_GETTER]); | 5139 assertErrors(source, [StaticTypeWarningCode.UNDEFINED_GETTER]); |
| 5047 } | 5140 } |
| 5048 void test_undefinedGetter_static() { | 5141 void test_undefinedGetter_static() { |
| 5049 Source source = addSource(EngineTestCase.createSource(["class A {}", "var a
= A.B;"])); | 5142 Source source = addSource(EngineTestCase.createSource(["class A {}", "var a
= A.B;"])); |
| 5050 resolve(source); | 5143 resolve(source); |
| 5051 assertErrors(source, [StaticTypeWarningCode.UNDEFINED_GETTER]); | 5144 assertErrors(source, [StaticTypeWarningCode.UNDEFINED_GETTER]); |
| 5052 } | 5145 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 5075 "}", | 5168 "}", |
| 5076 "class C {", | 5169 "class C {", |
| 5077 " f() {", | 5170 " f() {", |
| 5078 " A a = new B();", | 5171 " A a = new B();", |
| 5079 " a.m();", | 5172 " a.m();", |
| 5080 " }", | 5173 " }", |
| 5081 "}"])); | 5174 "}"])); |
| 5082 resolve(source); | 5175 resolve(source); |
| 5083 assertErrors(source, [StaticTypeWarningCode.UNDEFINED_METHOD]); | 5176 assertErrors(source, [StaticTypeWarningCode.UNDEFINED_METHOD]); |
| 5084 } | 5177 } |
| 5178 void test_undefinedMethod_private() { |
| 5179 addSource2("/lib.dart", EngineTestCase.createSource(["library lib;", "class
A {", " _foo() {}", "}"])); |
| 5180 Source source = addSource(EngineTestCase.createSource([ |
| 5181 "import 'lib.dart';", |
| 5182 "class B extends A {", |
| 5183 " test() {", |
| 5184 " _foo();", |
| 5185 " }", |
| 5186 "}"])); |
| 5187 resolve(source); |
| 5188 assertErrors(source, [StaticTypeWarningCode.UNDEFINED_METHOD]); |
| 5189 } |
| 5085 void test_undefinedOperator_indexBoth() { | 5190 void test_undefinedOperator_indexBoth() { |
| 5086 Source source = addSource(EngineTestCase.createSource(["class A {}", "f(A a)
{", " a[0]++;", "}"])); | 5191 Source source = addSource(EngineTestCase.createSource(["class A {}", "f(A a)
{", " a[0]++;", "}"])); |
| 5087 resolve(source); | 5192 resolve(source); |
| 5088 assertErrors(source, [ | 5193 assertErrors(source, [ |
| 5089 StaticTypeWarningCode.UNDEFINED_OPERATOR, | 5194 StaticTypeWarningCode.UNDEFINED_OPERATOR, |
| 5090 StaticTypeWarningCode.UNDEFINED_OPERATOR]); | 5195 StaticTypeWarningCode.UNDEFINED_OPERATOR]); |
| 5091 } | 5196 } |
| 5092 void test_undefinedOperator_indexGetter() { | 5197 void test_undefinedOperator_indexGetter() { |
| 5093 Source source = addSource(EngineTestCase.createSource(["class A {}", "f(A a)
{", " a[0];", "}"])); | 5198 Source source = addSource(EngineTestCase.createSource(["class A {}", "f(A a)
{", " a[0];", "}"])); |
| 5094 resolve(source); | 5199 resolve(source); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5204 "class C<E> {}", | 5309 "class C<E> {}", |
| 5205 "f(p) {", | 5310 "f(p) {", |
| 5206 " return p is C<A, A>;", | 5311 " return p is C<A, A>;", |
| 5207 "}"])); | 5312 "}"])); |
| 5208 resolve(source); | 5313 resolve(source); |
| 5209 assertErrors(source, [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS])
; | 5314 assertErrors(source, [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS])
; |
| 5210 verify([source]); | 5315 verify([source]); |
| 5211 } | 5316 } |
| 5212 static dartSuite() { | 5317 static dartSuite() { |
| 5213 _ut.group('StaticTypeWarningCodeTest', () { | 5318 _ut.group('StaticTypeWarningCodeTest', () { |
| 5319 _ut.test('test_expectedOneListTypeArgument', () { |
| 5320 final __test = new StaticTypeWarningCodeTest(); |
| 5321 runJUnitTest(__test, __test.test_expectedOneListTypeArgument); |
| 5322 }); |
| 5323 _ut.test('test_expectedTwoMapTypeArguments_one', () { |
| 5324 final __test = new StaticTypeWarningCodeTest(); |
| 5325 runJUnitTest(__test, __test.test_expectedTwoMapTypeArguments_one); |
| 5326 }); |
| 5327 _ut.test('test_expectedTwoMapTypeArguments_three', () { |
| 5328 final __test = new StaticTypeWarningCodeTest(); |
| 5329 runJUnitTest(__test, __test.test_expectedTwoMapTypeArguments_three); |
| 5330 }); |
| 5214 _ut.test('test_inconsistentMethodInheritance_paramCount', () { | 5331 _ut.test('test_inconsistentMethodInheritance_paramCount', () { |
| 5215 final __test = new StaticTypeWarningCodeTest(); | 5332 final __test = new StaticTypeWarningCodeTest(); |
| 5216 runJUnitTest(__test, __test.test_inconsistentMethodInheritance_paramCoun
t); | 5333 runJUnitTest(__test, __test.test_inconsistentMethodInheritance_paramCoun
t); |
| 5217 }); | 5334 }); |
| 5218 _ut.test('test_inconsistentMethodInheritance_paramType', () { | 5335 _ut.test('test_inconsistentMethodInheritance_paramType', () { |
| 5219 final __test = new StaticTypeWarningCodeTest(); | 5336 final __test = new StaticTypeWarningCodeTest(); |
| 5220 runJUnitTest(__test, __test.test_inconsistentMethodInheritance_paramType
); | 5337 runJUnitTest(__test, __test.test_inconsistentMethodInheritance_paramType
); |
| 5221 }); | 5338 }); |
| 5222 _ut.test('test_inconsistentMethodInheritance_returnType', () { | 5339 _ut.test('test_inconsistentMethodInheritance_returnType', () { |
| 5223 final __test = new StaticTypeWarningCodeTest(); | 5340 final __test = new StaticTypeWarningCodeTest(); |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5432 runJUnitTest(__test, __test.test_typeArgumentNotMatchingBounds_typeParam
eter); | 5549 runJUnitTest(__test, __test.test_typeArgumentNotMatchingBounds_typeParam
eter); |
| 5433 }); | 5550 }); |
| 5434 _ut.test('test_typeArgumentNotMatchingBounds_variableDeclaration', () { | 5551 _ut.test('test_typeArgumentNotMatchingBounds_variableDeclaration', () { |
| 5435 final __test = new StaticTypeWarningCodeTest(); | 5552 final __test = new StaticTypeWarningCodeTest(); |
| 5436 runJUnitTest(__test, __test.test_typeArgumentNotMatchingBounds_variableD
eclaration); | 5553 runJUnitTest(__test, __test.test_typeArgumentNotMatchingBounds_variableD
eclaration); |
| 5437 }); | 5554 }); |
| 5438 _ut.test('test_typeArgumentNotMatchingBounds_with', () { | 5555 _ut.test('test_typeArgumentNotMatchingBounds_with', () { |
| 5439 final __test = new StaticTypeWarningCodeTest(); | 5556 final __test = new StaticTypeWarningCodeTest(); |
| 5440 runJUnitTest(__test, __test.test_typeArgumentNotMatchingBounds_with); | 5557 runJUnitTest(__test, __test.test_typeArgumentNotMatchingBounds_with); |
| 5441 }); | 5558 }); |
| 5559 _ut.test('test_typeParameterSupertypeOfItsBound', () { |
| 5560 final __test = new StaticTypeWarningCodeTest(); |
| 5561 runJUnitTest(__test, __test.test_typeParameterSupertypeOfItsBound); |
| 5562 }); |
| 5442 _ut.test('test_undefinedGetter', () { | 5563 _ut.test('test_undefinedGetter', () { |
| 5443 final __test = new StaticTypeWarningCodeTest(); | 5564 final __test = new StaticTypeWarningCodeTest(); |
| 5444 runJUnitTest(__test, __test.test_undefinedGetter); | 5565 runJUnitTest(__test, __test.test_undefinedGetter); |
| 5445 }); | 5566 }); |
| 5446 _ut.test('test_undefinedGetter_static', () { | 5567 _ut.test('test_undefinedGetter_static', () { |
| 5447 final __test = new StaticTypeWarningCodeTest(); | 5568 final __test = new StaticTypeWarningCodeTest(); |
| 5448 runJUnitTest(__test, __test.test_undefinedGetter_static); | 5569 runJUnitTest(__test, __test.test_undefinedGetter_static); |
| 5449 }); | 5570 }); |
| 5450 _ut.test('test_undefinedMethod', () { | 5571 _ut.test('test_undefinedMethod', () { |
| 5451 final __test = new StaticTypeWarningCodeTest(); | 5572 final __test = new StaticTypeWarningCodeTest(); |
| 5452 runJUnitTest(__test, __test.test_undefinedMethod); | 5573 runJUnitTest(__test, __test.test_undefinedMethod); |
| 5453 }); | 5574 }); |
| 5454 _ut.test('test_undefinedMethod_assignmentExpression', () { | 5575 _ut.test('test_undefinedMethod_assignmentExpression', () { |
| 5455 final __test = new StaticTypeWarningCodeTest(); | 5576 final __test = new StaticTypeWarningCodeTest(); |
| 5456 runJUnitTest(__test, __test.test_undefinedMethod_assignmentExpression); | 5577 runJUnitTest(__test, __test.test_undefinedMethod_assignmentExpression); |
| 5457 }); | 5578 }); |
| 5458 _ut.test('test_undefinedMethod_ignoreTypePropagation', () { | 5579 _ut.test('test_undefinedMethod_ignoreTypePropagation', () { |
| 5459 final __test = new StaticTypeWarningCodeTest(); | 5580 final __test = new StaticTypeWarningCodeTest(); |
| 5460 runJUnitTest(__test, __test.test_undefinedMethod_ignoreTypePropagation); | 5581 runJUnitTest(__test, __test.test_undefinedMethod_ignoreTypePropagation); |
| 5461 }); | 5582 }); |
| 5583 _ut.test('test_undefinedMethod_private', () { |
| 5584 final __test = new StaticTypeWarningCodeTest(); |
| 5585 runJUnitTest(__test, __test.test_undefinedMethod_private); |
| 5586 }); |
| 5462 _ut.test('test_undefinedOperator_indexBoth', () { | 5587 _ut.test('test_undefinedOperator_indexBoth', () { |
| 5463 final __test = new StaticTypeWarningCodeTest(); | 5588 final __test = new StaticTypeWarningCodeTest(); |
| 5464 runJUnitTest(__test, __test.test_undefinedOperator_indexBoth); | 5589 runJUnitTest(__test, __test.test_undefinedOperator_indexBoth); |
| 5465 }); | 5590 }); |
| 5466 _ut.test('test_undefinedOperator_indexGetter', () { | 5591 _ut.test('test_undefinedOperator_indexGetter', () { |
| 5467 final __test = new StaticTypeWarningCodeTest(); | 5592 final __test = new StaticTypeWarningCodeTest(); |
| 5468 runJUnitTest(__test, __test.test_undefinedOperator_indexGetter); | 5593 runJUnitTest(__test, __test.test_undefinedOperator_indexGetter); |
| 5469 }); | 5594 }); |
| 5470 _ut.test('test_undefinedOperator_indexSetter', () { | 5595 _ut.test('test_undefinedOperator_indexSetter', () { |
| 5471 final __test = new StaticTypeWarningCodeTest(); | 5596 final __test = new StaticTypeWarningCodeTest(); |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5917 "class B {", | 6042 "class B {", |
| 5918 " f(var a, var a2) {", | 6043 " f(var a, var a2) {", |
| 5919 " a = new A();", | 6044 " a = new A();", |
| 5920 " a2 = new A();", | 6045 " a2 = new A();", |
| 5921 " a += a2;", | 6046 " a += a2;", |
| 5922 " }", | 6047 " }", |
| 5923 "}"])); | 6048 "}"])); |
| 5924 resolve(source); | 6049 resolve(source); |
| 5925 assertErrors(source, [HintCode.UNDEFINED_METHOD]); | 6050 assertErrors(source, [HintCode.UNDEFINED_METHOD]); |
| 5926 } | 6051 } |
| 6052 void test_undefinedOperator_binaryExpression() { |
| 6053 Source source = addSource(EngineTestCase.createSource([ |
| 6054 "class A {}", |
| 6055 "f(var a) {", |
| 6056 " if(a is A) {", |
| 6057 " a + 1;", |
| 6058 " }", |
| 6059 "}"])); |
| 6060 resolve(source); |
| 6061 assertErrors(source, [HintCode.UNDEFINED_OPERATOR]); |
| 6062 } |
| 5927 void test_undefinedOperator_indexBoth() { | 6063 void test_undefinedOperator_indexBoth() { |
| 5928 Source source = addSource(EngineTestCase.createSource([ | 6064 Source source = addSource(EngineTestCase.createSource([ |
| 5929 "class A {}", | 6065 "class A {}", |
| 5930 "f(var a) {", | 6066 "f(var a) {", |
| 5931 " if(a is A) {", | 6067 " if(a is A) {", |
| 5932 " a[0]++;", | 6068 " a[0]++;", |
| 5933 " }", | 6069 " }", |
| 5934 "}"])); | 6070 "}"])); |
| 5935 resolve(source); | 6071 resolve(source); |
| 5936 assertErrors(source, [HintCode.UNDEFINED_OPERATOR, HintCode.UNDEFINED_OPERAT
OR]); | 6072 assertErrors(source, [HintCode.UNDEFINED_OPERATOR, HintCode.UNDEFINED_OPERAT
OR]); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 5948 } | 6084 } |
| 5949 void test_undefinedOperator_indexSetter() { | 6085 void test_undefinedOperator_indexSetter() { |
| 5950 Source source = addSource(EngineTestCase.createSource([ | 6086 Source source = addSource(EngineTestCase.createSource([ |
| 5951 "class A {}", | 6087 "class A {}", |
| 5952 "f(var a) {", | 6088 "f(var a) {", |
| 5953 " if(a is A) {", | 6089 " if(a is A) {", |
| 5954 " a[0] = 1;", | 6090 " a[0] = 1;", |
| 5955 " }", | 6091 " }", |
| 5956 "}"])); | 6092 "}"])); |
| 5957 resolve(source); | 6093 resolve(source); |
| 5958 assertErrors(source, [HintCode.UNDEFINED_OPERATOR]); | |
| 5959 } | |
| 5960 void test_undefinedOperator_plus() { | |
| 5961 Source source = addSource(EngineTestCase.createSource([ | |
| 5962 "class A {}", | |
| 5963 "f(var a) {", | |
| 5964 " if(a is A) {", | |
| 5965 " a + 1;", | |
| 5966 " }", | |
| 5967 "}"])); | |
| 5968 resolve(source); | |
| 5969 assertErrors(source, [HintCode.UNDEFINED_OPERATOR]); | 6094 assertErrors(source, [HintCode.UNDEFINED_OPERATOR]); |
| 5970 } | 6095 } |
| 5971 void test_undefinedOperator_postfixExpression() { | 6096 void test_undefinedOperator_postfixExpression() { |
| 5972 Source source = addSource(EngineTestCase.createSource([ | 6097 Source source = addSource(EngineTestCase.createSource([ |
| 5973 "class A {}", | 6098 "class A {}", |
| 5974 "f(var a) {", | 6099 "f(var a) {", |
| 5975 " if(a is A) {", | 6100 " if(a is A) {", |
| 5976 " a++;", | 6101 " a++;", |
| 5977 " }", | 6102 " }", |
| 5978 "}"])); | 6103 "}"])); |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6267 runJUnitTest(__test, __test.test_undefinedGetter_message); | 6392 runJUnitTest(__test, __test.test_undefinedGetter_message); |
| 6268 }); | 6393 }); |
| 6269 _ut.test('test_undefinedMethod', () { | 6394 _ut.test('test_undefinedMethod', () { |
| 6270 final __test = new HintCodeTest(); | 6395 final __test = new HintCodeTest(); |
| 6271 runJUnitTest(__test, __test.test_undefinedMethod); | 6396 runJUnitTest(__test, __test.test_undefinedMethod); |
| 6272 }); | 6397 }); |
| 6273 _ut.test('test_undefinedMethod_assignmentExpression', () { | 6398 _ut.test('test_undefinedMethod_assignmentExpression', () { |
| 6274 final __test = new HintCodeTest(); | 6399 final __test = new HintCodeTest(); |
| 6275 runJUnitTest(__test, __test.test_undefinedMethod_assignmentExpression); | 6400 runJUnitTest(__test, __test.test_undefinedMethod_assignmentExpression); |
| 6276 }); | 6401 }); |
| 6402 _ut.test('test_undefinedOperator_binaryExpression', () { |
| 6403 final __test = new HintCodeTest(); |
| 6404 runJUnitTest(__test, __test.test_undefinedOperator_binaryExpression); |
| 6405 }); |
| 6277 _ut.test('test_undefinedOperator_indexBoth', () { | 6406 _ut.test('test_undefinedOperator_indexBoth', () { |
| 6278 final __test = new HintCodeTest(); | 6407 final __test = new HintCodeTest(); |
| 6279 runJUnitTest(__test, __test.test_undefinedOperator_indexBoth); | 6408 runJUnitTest(__test, __test.test_undefinedOperator_indexBoth); |
| 6280 }); | 6409 }); |
| 6281 _ut.test('test_undefinedOperator_indexGetter', () { | 6410 _ut.test('test_undefinedOperator_indexGetter', () { |
| 6282 final __test = new HintCodeTest(); | 6411 final __test = new HintCodeTest(); |
| 6283 runJUnitTest(__test, __test.test_undefinedOperator_indexGetter); | 6412 runJUnitTest(__test, __test.test_undefinedOperator_indexGetter); |
| 6284 }); | 6413 }); |
| 6285 _ut.test('test_undefinedOperator_indexSetter', () { | 6414 _ut.test('test_undefinedOperator_indexSetter', () { |
| 6286 final __test = new HintCodeTest(); | 6415 final __test = new HintCodeTest(); |
| 6287 runJUnitTest(__test, __test.test_undefinedOperator_indexSetter); | 6416 runJUnitTest(__test, __test.test_undefinedOperator_indexSetter); |
| 6288 }); | 6417 }); |
| 6289 _ut.test('test_undefinedOperator_plus', () { | |
| 6290 final __test = new HintCodeTest(); | |
| 6291 runJUnitTest(__test, __test.test_undefinedOperator_plus); | |
| 6292 }); | |
| 6293 _ut.test('test_undefinedOperator_postfixExpression', () { | 6418 _ut.test('test_undefinedOperator_postfixExpression', () { |
| 6294 final __test = new HintCodeTest(); | 6419 final __test = new HintCodeTest(); |
| 6295 runJUnitTest(__test, __test.test_undefinedOperator_postfixExpression); | 6420 runJUnitTest(__test, __test.test_undefinedOperator_postfixExpression); |
| 6296 }); | 6421 }); |
| 6297 _ut.test('test_undefinedOperator_prefixExpression', () { | 6422 _ut.test('test_undefinedOperator_prefixExpression', () { |
| 6298 final __test = new HintCodeTest(); | 6423 final __test = new HintCodeTest(); |
| 6299 runJUnitTest(__test, __test.test_undefinedOperator_prefixExpression); | 6424 runJUnitTest(__test, __test.test_undefinedOperator_prefixExpression); |
| 6300 }); | 6425 }); |
| 6301 _ut.test('test_undefinedSetter', () { | 6426 _ut.test('test_undefinedSetter', () { |
| 6302 final __test = new HintCodeTest(); | 6427 final __test = new HintCodeTest(); |
| (...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7734 CompileTimeErrorCode.UNDEFINED_FUNCTION]); | 7859 CompileTimeErrorCode.UNDEFINED_FUNCTION]); |
| 7735 } | 7860 } |
| 7736 void test_argumentDefinitionTestNonParameter() { | 7861 void test_argumentDefinitionTestNonParameter() { |
| 7737 Source source = addSource(EngineTestCase.createSource(["f() {", " var v = 0;
", " return ?v;", "}"])); | 7862 Source source = addSource(EngineTestCase.createSource(["f() {", " var v = 0;
", " return ?v;", "}"])); |
| 7738 resolve(source); | 7863 resolve(source); |
| 7739 assertErrors(source, [ | 7864 assertErrors(source, [ |
| 7740 ParserErrorCode.DEPRECATED_ARGUMENT_DEFINITION_TEST, | 7865 ParserErrorCode.DEPRECATED_ARGUMENT_DEFINITION_TEST, |
| 7741 CompileTimeErrorCode.ARGUMENT_DEFINITION_TEST_NON_PARAMETER]); | 7866 CompileTimeErrorCode.ARGUMENT_DEFINITION_TEST_NON_PARAMETER]); |
| 7742 verify([source]); | 7867 verify([source]); |
| 7743 } | 7868 } |
| 7869 void test_builtInIdentifierAsMixinName_classTypeAlias() { |
| 7870 Source source = addSource(EngineTestCase.createSource(["class A {}", "class
B {}", "class as = A with B;"])); |
| 7871 resolve(source); |
| 7872 assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NA
ME]); |
| 7873 verify([source]); |
| 7874 } |
| 7744 void test_builtInIdentifierAsType_formalParameter_field() { | 7875 void test_builtInIdentifierAsType_formalParameter_field() { |
| 7745 Source source = addSource(EngineTestCase.createSource(["class A {", " var x
;", " A(static this.x);", "}"])); | 7876 Source source = addSource(EngineTestCase.createSource(["class A {", " var x
;", " A(static this.x);", "}"])); |
| 7746 resolve(source); | 7877 resolve(source); |
| 7747 assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]); | 7878 assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]); |
| 7748 verify([source]); | 7879 verify([source]); |
| 7749 } | 7880 } |
| 7750 void test_builtInIdentifierAsType_formalParameter_simple() { | 7881 void test_builtInIdentifierAsType_formalParameter_simple() { |
| 7751 Source source = addSource(EngineTestCase.createSource(["f(static x) {", "}"]
)); | 7882 Source source = addSource(EngineTestCase.createSource(["f(static x) {", "}"]
)); |
| 7752 resolve(source); | 7883 resolve(source); |
| 7753 assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]); | 7884 assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]); |
| 7754 verify([source]); | 7885 verify([source]); |
| 7755 } | 7886 } |
| 7756 void test_builtInIdentifierAsType_variableDeclaration() { | 7887 void test_builtInIdentifierAsType_variableDeclaration() { |
| 7757 Source source = addSource(EngineTestCase.createSource(["f() {", " typedef x
;", "}"])); | 7888 Source source = addSource(EngineTestCase.createSource(["f() {", " typedef x
;", "}"])); |
| 7758 resolve(source); | 7889 resolve(source); |
| 7759 assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]); | 7890 assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]); |
| 7760 verify([source]); | 7891 verify([source]); |
| 7761 } | 7892 } |
| 7762 void test_builtInIdentifierAsTypedefName_classTypeAlias() { | |
| 7763 Source source = addSource(EngineTestCase.createSource(["class A {}", "class
B {}", "typedef as = A with B;"])); | |
| 7764 resolve(source); | |
| 7765 assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NA
ME]); | |
| 7766 verify([source]); | |
| 7767 } | |
| 7768 void test_builtInIdentifierAsTypedefName_functionTypeAlias() { | 7893 void test_builtInIdentifierAsTypedefName_functionTypeAlias() { |
| 7769 Source source = addSource(EngineTestCase.createSource(["typedef bool as();"]
)); | 7894 Source source = addSource(EngineTestCase.createSource(["typedef bool as();"]
)); |
| 7770 resolve(source); | 7895 resolve(source); |
| 7771 assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NA
ME]); | 7896 assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NA
ME]); |
| 7772 verify([source]); | 7897 verify([source]); |
| 7773 } | 7898 } |
| 7774 void test_builtInIdentifierAsTypeName() { | 7899 void test_builtInIdentifierAsTypeName() { |
| 7775 Source source = addSource(EngineTestCase.createSource(["class as {}"])); | 7900 Source source = addSource(EngineTestCase.createSource(["class as {}"])); |
| 7776 resolve(source); | 7901 resolve(source); |
| 7777 assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME]
); | 7902 assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME]
); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7857 "class A {", | 7982 "class A {", |
| 7858 " m() {}", | 7983 " m() {}", |
| 7859 "}", | 7984 "}", |
| 7860 "class B extends A {", | 7985 "class B extends A {", |
| 7861 " get m => 0;", | 7986 " get m => 0;", |
| 7862 "}"])); | 7987 "}"])); |
| 7863 resolve(source); | 7988 resolve(source); |
| 7864 assertErrors(source, [CompileTimeErrorCode.CONFLICTING_METHOD_AND_GETTER]); | 7989 assertErrors(source, [CompileTimeErrorCode.CONFLICTING_METHOD_AND_GETTER]); |
| 7865 verify([source]); | 7990 verify([source]); |
| 7866 } | 7991 } |
| 7992 void test_conflictingTypeVariableAndClass() { |
| 7993 Source source = addSource(EngineTestCase.createSource(["class T<T> {", "}"])
); |
| 7994 resolve(source); |
| 7995 assertErrors(source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLA
SS]); |
| 7996 verify([source]); |
| 7997 } |
| 7998 void test_conflictingTypeVariableAndMember_field() { |
| 7999 Source source = addSource(EngineTestCase.createSource(["class A<T> {", " va
r T;", "}"])); |
| 8000 resolve(source); |
| 8001 assertErrors(source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEM
BER]); |
| 8002 verify([source]); |
| 8003 } |
| 8004 void test_conflictingTypeVariableAndMember_getter() { |
| 8005 Source source = addSource(EngineTestCase.createSource(["class A<T> {", " ge
t T => null;", "}"])); |
| 8006 resolve(source); |
| 8007 assertErrors(source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEM
BER]); |
| 8008 verify([source]); |
| 8009 } |
| 8010 void test_conflictingTypeVariableAndMember_method() { |
| 8011 Source source = addSource(EngineTestCase.createSource(["class A<T> {", " T(
) {}", "}"])); |
| 8012 resolve(source); |
| 8013 assertErrors(source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEM
BER]); |
| 8014 verify([source]); |
| 8015 } |
| 8016 void test_conflictingTypeVariableAndMember_method_static() { |
| 8017 Source source = addSource(EngineTestCase.createSource(["class A<T> {", " st
atic T() {}", "}"])); |
| 8018 resolve(source); |
| 8019 assertErrors(source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEM
BER]); |
| 8020 verify([source]); |
| 8021 } |
| 8022 void test_conflictingTypeVariableAndMember_setter() { |
| 8023 Source source = addSource(EngineTestCase.createSource(["class A<T> {", " se
t T(x) {}", "}"])); |
| 8024 resolve(source); |
| 8025 assertErrors(source, [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEM
BER]); |
| 8026 verify([source]); |
| 8027 } |
| 7867 void test_constConstructorWithNonConstSuper_explicit() { | 8028 void test_constConstructorWithNonConstSuper_explicit() { |
| 7868 Source source = addSource(EngineTestCase.createSource([ | 8029 Source source = addSource(EngineTestCase.createSource([ |
| 7869 "class A {", | 8030 "class A {", |
| 7870 " A();", | 8031 " A();", |
| 7871 "}", | 8032 "}", |
| 7872 "class B extends A {", | 8033 "class B extends A {", |
| 7873 " const B(): super();", | 8034 " const B(): super();", |
| 7874 "}"])); | 8035 "}"])); |
| 7875 resolve(source); | 8036 resolve(source); |
| 7876 assertErrors(source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_
SUPER]); | 8037 assertErrors(source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_
SUPER]); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8060 resolve(source); | 8221 resolve(source); |
| 8061 assertErrors(source, [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTA
NT_VALUE]); | 8222 assertErrors(source, [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTA
NT_VALUE]); |
| 8062 verify([source]); | 8223 verify([source]); |
| 8063 } | 8224 } |
| 8064 void test_constInstanceField() { | 8225 void test_constInstanceField() { |
| 8065 Source source = addSource(EngineTestCase.createSource(["class C {", " const
int f = 0;", "}"])); | 8226 Source source = addSource(EngineTestCase.createSource(["class C {", " const
int f = 0;", "}"])); |
| 8066 resolve(source); | 8227 resolve(source); |
| 8067 assertErrors(source, [CompileTimeErrorCode.CONST_INSTANCE_FIELD]); | 8228 assertErrors(source, [CompileTimeErrorCode.CONST_INSTANCE_FIELD]); |
| 8068 verify([source]); | 8229 verify([source]); |
| 8069 } | 8230 } |
| 8231 void test_constMapKeyTypeImplementsEquals_direct() { |
| 8232 Source source = addSource(EngineTestCase.createSource([ |
| 8233 "class A {", |
| 8234 " const A();", |
| 8235 " operator ==(other) => false;", |
| 8236 "}", |
| 8237 "main() {", |
| 8238 " const {const A() : 0};", |
| 8239 "}"])); |
| 8240 resolve(source); |
| 8241 assertErrors(source, [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMP
LEMENTS_EQUALS]); |
| 8242 verify([source]); |
| 8243 } |
| 8244 void test_constMapKeyTypeImplementsEquals_super() { |
| 8245 Source source = addSource(EngineTestCase.createSource([ |
| 8246 "class A {", |
| 8247 " const A();", |
| 8248 " operator ==(other) => false;", |
| 8249 "}", |
| 8250 "class B extends A {", |
| 8251 " const B();", |
| 8252 "}", |
| 8253 "main() {", |
| 8254 " const {const B() : 0};", |
| 8255 "}"])); |
| 8256 resolve(source); |
| 8257 assertErrors(source, [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMP
LEMENTS_EQUALS]); |
| 8258 verify([source]); |
| 8259 } |
| 8070 void test_constWithInvalidTypeParameters() { | 8260 void test_constWithInvalidTypeParameters() { |
| 8071 Source source = addSource(EngineTestCase.createSource([ | 8261 Source source = addSource(EngineTestCase.createSource([ |
| 8072 "class A {", | 8262 "class A {", |
| 8073 " const A();", | 8263 " const A();", |
| 8074 "}", | 8264 "}", |
| 8075 "f() { return const A<A>(); }"])); | 8265 "f() { return const A<A>(); }"])); |
| 8076 resolve(source); | 8266 resolve(source); |
| 8077 assertErrors(source, [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETER
S]); | 8267 assertErrors(source, [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETER
S]); |
| 8078 verify([source]); | 8268 verify([source]); |
| 8079 } | 8269 } |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8678 resolve(source); | 8868 resolve(source); |
| 8679 assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DYNAMIC]); | 8869 assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_DYNAMIC]); |
| 8680 verify([source]); | 8870 verify([source]); |
| 8681 } | 8871 } |
| 8682 void test_implementsNonClass_class() { | 8872 void test_implementsNonClass_class() { |
| 8683 Source source = addSource(EngineTestCase.createSource(["int A;", "class B im
plements A {}"])); | 8873 Source source = addSource(EngineTestCase.createSource(["int A;", "class B im
plements A {}"])); |
| 8684 resolve(source); | 8874 resolve(source); |
| 8685 assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]); | 8875 assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]); |
| 8686 verify([source]); | 8876 verify([source]); |
| 8687 } | 8877 } |
| 8688 void test_implementsNonClass_typedef() { | 8878 void test_implementsNonClass_typeAlias() { |
| 8689 Source source = addSource(EngineTestCase.createSource(["class A {}", "int B;
", "typedef C = A implements B;"])); | 8879 Source source = addSource(EngineTestCase.createSource(["class A {}", "int B;
", "class C = A implements B;"])); |
| 8690 resolve(source); | 8880 resolve(source); |
| 8691 assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]); | 8881 assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_NON_CLASS]); |
| 8692 verify([source]); | 8882 verify([source]); |
| 8693 } | 8883 } |
| 8694 void test_implementsRepeated() { | 8884 void test_implementsRepeated() { |
| 8695 Source source = addSource(EngineTestCase.createSource(["class A {}", "class
B implements A, A {}"])); | 8885 Source source = addSource(EngineTestCase.createSource(["class A {}", "class
B implements A, A {}"])); |
| 8696 resolve(source); | 8886 resolve(source); |
| 8697 assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_REPEATED]); | 8887 assertErrors(source, [CompileTimeErrorCode.IMPLEMENTS_REPEATED]); |
| 8698 verify([source]); | 8888 verify([source]); |
| 8699 } | 8889 } |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9162 void test_mixinDeclaresConstructor_classDeclaration() { | 9352 void test_mixinDeclaresConstructor_classDeclaration() { |
| 9163 Source source = addSource(EngineTestCase.createSource([ | 9353 Source source = addSource(EngineTestCase.createSource([ |
| 9164 "class A {", | 9354 "class A {", |
| 9165 " A() {}", | 9355 " A() {}", |
| 9166 "}", | 9356 "}", |
| 9167 "class B extends Object with A {}"])); | 9357 "class B extends Object with A {}"])); |
| 9168 resolve(source); | 9358 resolve(source); |
| 9169 assertErrors(source, [CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR]); | 9359 assertErrors(source, [CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR]); |
| 9170 verify([source]); | 9360 verify([source]); |
| 9171 } | 9361 } |
| 9172 void test_mixinDeclaresConstructor_typedef() { | 9362 void test_mixinDeclaresConstructor_typeAlias() { |
| 9173 Source source = addSource(EngineTestCase.createSource([ | 9363 Source source = addSource(EngineTestCase.createSource(["class A {", " A() {
}", "}", "class B = Object with A;"])); |
| 9174 "class A {", | |
| 9175 " A() {}", | |
| 9176 "}", | |
| 9177 "typedef B = Object with A;"])); | |
| 9178 resolve(source); | 9364 resolve(source); |
| 9179 assertErrors(source, [CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR]); | 9365 assertErrors(source, [CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR]); |
| 9180 verify([source]); | 9366 verify([source]); |
| 9181 } | 9367 } |
| 9182 void test_mixinInheritsFromNotObject_classDeclaration_extends() { | 9368 void test_mixinInheritsFromNotObject_classDeclaration_extends() { |
| 9183 Source source = addSource(EngineTestCase.createSource([ | 9369 Source source = addSource(EngineTestCase.createSource([ |
| 9184 "class A {}", | 9370 "class A {}", |
| 9185 "class B extends A {}", | 9371 "class B extends A {}", |
| 9186 "class C extends Object with B {}"])); | 9372 "class C extends Object with B {}"])); |
| 9187 resolve(source); | 9373 resolve(source); |
| 9188 assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]); | 9374 assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]); |
| 9189 verify([source]); | 9375 verify([source]); |
| 9190 } | 9376 } |
| 9191 void test_mixinInheritsFromNotObject_classDeclaration_with() { | 9377 void test_mixinInheritsFromNotObject_classDeclaration_with() { |
| 9192 Source source = addSource(EngineTestCase.createSource([ | 9378 Source source = addSource(EngineTestCase.createSource([ |
| 9193 "class A {}", | 9379 "class A {}", |
| 9194 "class B extends Object with A {}", | 9380 "class B extends Object with A {}", |
| 9195 "class C extends Object with B {}"])); | 9381 "class C extends Object with B {}"])); |
| 9196 resolve(source); | 9382 resolve(source); |
| 9197 assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]); | 9383 assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]); |
| 9198 verify([source]); | 9384 verify([source]); |
| 9199 } | 9385 } |
| 9200 void test_mixinInheritsFromNotObject_typedef_extends() { | 9386 void test_mixinInheritsFromNotObject_typeAlias_extends() { |
| 9201 Source source = addSource(EngineTestCase.createSource([ | 9387 Source source = addSource(EngineTestCase.createSource([ |
| 9202 "class A {}", | 9388 "class A {}", |
| 9203 "class B extends A {}", | 9389 "class B extends A {}", |
| 9204 "typedef C = Object with B;"])); | 9390 "class C = Object with B;"])); |
| 9205 resolve(source); | 9391 resolve(source); |
| 9206 assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]); | 9392 assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]); |
| 9207 verify([source]); | 9393 verify([source]); |
| 9208 } | 9394 } |
| 9209 void test_mixinInheritsFromNotObject_typedef_with() { | 9395 void test_mixinInheritsFromNotObject_typeAlias_with() { |
| 9210 Source source = addSource(EngineTestCase.createSource([ | 9396 Source source = addSource(EngineTestCase.createSource([ |
| 9211 "class A {}", | 9397 "class A {}", |
| 9212 "class B extends Object with A {}", | 9398 "class B extends Object with A {}", |
| 9213 "typedef C = Object with B;"])); | 9399 "class C = Object with B;"])); |
| 9214 resolve(source); | 9400 resolve(source); |
| 9215 assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]); | 9401 assertErrors(source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]); |
| 9216 verify([source]); | 9402 verify([source]); |
| 9217 } | 9403 } |
| 9218 void test_mixinOfDisallowedClass_bool() { | 9404 void test_mixinOfDisallowedClass_bool() { |
| 9219 Source source = addSource(EngineTestCase.createSource(["class A extends Obje
ct with bool {}"])); | 9405 Source source = addSource(EngineTestCase.createSource(["class A extends Obje
ct with bool {}"])); |
| 9220 resolve(source); | 9406 resolve(source); |
| 9221 assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); | 9407 assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); |
| 9222 verify([source]); | 9408 verify([source]); |
| 9223 } | 9409 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 9250 resolve(source); | 9436 resolve(source); |
| 9251 assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); | 9437 assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS]); |
| 9252 verify([source]); | 9438 verify([source]); |
| 9253 } | 9439 } |
| 9254 void test_mixinOfNonClass_class() { | 9440 void test_mixinOfNonClass_class() { |
| 9255 Source source = addSource(EngineTestCase.createSource(["int A;", "class B ex
tends Object with A {}"])); | 9441 Source source = addSource(EngineTestCase.createSource(["int A;", "class B ex
tends Object with A {}"])); |
| 9256 resolve(source); | 9442 resolve(source); |
| 9257 assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_NON_CLASS]); | 9443 assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_NON_CLASS]); |
| 9258 verify([source]); | 9444 verify([source]); |
| 9259 } | 9445 } |
| 9260 void test_mixinOfNonClass_typedef() { | 9446 void test_mixinOfNonClass_typeAlias() { |
| 9261 Source source = addSource(EngineTestCase.createSource(["class A {}", "int B;
", "typedef C = A with B;"])); | 9447 Source source = addSource(EngineTestCase.createSource(["class A {}", "int B;
", "class C = A with B;"])); |
| 9262 resolve(source); | 9448 resolve(source); |
| 9263 assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_NON_CLASS]); | 9449 assertErrors(source, [CompileTimeErrorCode.MIXIN_OF_NON_CLASS]); |
| 9264 verify([source]); | 9450 verify([source]); |
| 9265 } | 9451 } |
| 9266 void test_mixinReferencesSuper() { | 9452 void test_mixinReferencesSuper() { |
| 9267 Source source = addSource(EngineTestCase.createSource([ | 9453 Source source = addSource(EngineTestCase.createSource([ |
| 9268 "class A {", | 9454 "class A {", |
| 9269 " toString() => super.toString();", | 9455 " toString() => super.toString();", |
| 9270 "}", | 9456 "}", |
| 9271 "class B extends Object with A {}"])); | 9457 "class B extends Object with A {}"])); |
| 9272 resolve(source); | 9458 resolve(source); |
| 9273 assertErrors(source, [CompileTimeErrorCode.MIXIN_REFERENCES_SUPER]); | 9459 assertErrors(source, [CompileTimeErrorCode.MIXIN_REFERENCES_SUPER]); |
| 9274 verify([source]); | 9460 verify([source]); |
| 9275 } | 9461 } |
| 9276 void test_mixinWithNonClassSuperclass_class() { | 9462 void test_mixinWithNonClassSuperclass_class() { |
| 9277 Source source = addSource(EngineTestCase.createSource(["int A;", "class B {}
", "class C extends A with B {}"])); | 9463 Source source = addSource(EngineTestCase.createSource(["int A;", "class B {}
", "class C extends A with B {}"])); |
| 9278 resolve(source); | 9464 resolve(source); |
| 9279 assertErrors(source, [CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS])
; | 9465 assertErrors(source, [CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS])
; |
| 9280 verify([source]); | 9466 verify([source]); |
| 9281 } | 9467 } |
| 9282 void test_mixinWithNonClassSuperclass_typedef() { | 9468 void test_mixinWithNonClassSuperclass_typeAlias() { |
| 9283 Source source = addSource(EngineTestCase.createSource(["int A;", "class B {}
", "typedef C = A with B;"])); | 9469 Source source = addSource(EngineTestCase.createSource(["int A;", "class B {}
", "class C = A with B;"])); |
| 9284 resolve(source); | 9470 resolve(source); |
| 9285 assertErrors(source, [CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS])
; | 9471 assertErrors(source, [CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS])
; |
| 9286 verify([source]); | 9472 verify([source]); |
| 9287 } | 9473 } |
| 9288 void test_multipleRedirectingConstructorInvocations() { | 9474 void test_multipleRedirectingConstructorInvocations() { |
| 9289 Source source = addSource(EngineTestCase.createSource([ | 9475 Source source = addSource(EngineTestCase.createSource([ |
| 9290 "class A {", | 9476 "class A {", |
| 9291 " A() : this.a(), this.b();", | 9477 " A() : this.a(), this.b();", |
| 9292 " A.a() {}", | 9478 " A.a() {}", |
| 9293 " A.b() {}", | 9479 " A.b() {}", |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9825 resolve(source); | 10011 resolve(source); |
| 9826 assertErrors(source, [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_B
ASE_CASE_EXTENDS]); | 10012 assertErrors(source, [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_B
ASE_CASE_EXTENDS]); |
| 9827 verify([source]); | 10013 verify([source]); |
| 9828 } | 10014 } |
| 9829 void test_recursiveInterfaceInheritanceBaseCaseImplements() { | 10015 void test_recursiveInterfaceInheritanceBaseCaseImplements() { |
| 9830 Source source = addSource(EngineTestCase.createSource(["class A implements A
{}"])); | 10016 Source source = addSource(EngineTestCase.createSource(["class A implements A
{}"])); |
| 9831 resolve(source); | 10017 resolve(source); |
| 9832 assertErrors(source, [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_B
ASE_CASE_IMPLEMENTS]); | 10018 assertErrors(source, [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_B
ASE_CASE_IMPLEMENTS]); |
| 9833 verify([source]); | 10019 verify([source]); |
| 9834 } | 10020 } |
| 9835 void test_recursiveInterfaceInheritanceBaseCaseImplements_typedef() { | 10021 void test_recursiveInterfaceInheritanceBaseCaseImplements_typeAlias() { |
| 9836 Source source = addSource(EngineTestCase.createSource([ | 10022 Source source = addSource(EngineTestCase.createSource([ |
| 9837 "class A {}", | 10023 "class A {}", |
| 9838 "class M {}", | 10024 "class M {}", |
| 9839 "typedef B = A with M implements B;"])); | 10025 "class B = A with M implements B;"])); |
| 9840 resolve(source); | 10026 resolve(source); |
| 9841 assertErrors(source, [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_B
ASE_CASE_IMPLEMENTS]); | 10027 assertErrors(source, [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_B
ASE_CASE_IMPLEMENTS]); |
| 9842 verify([source]); | 10028 verify([source]); |
| 9843 } | 10029 } |
| 9844 void test_redirectToNonConstConstructor() { | 10030 void test_redirectToNonConstConstructor() { |
| 9845 Source source = addSource(EngineTestCase.createSource([ | 10031 Source source = addSource(EngineTestCase.createSource([ |
| 9846 "class A {", | 10032 "class A {", |
| 9847 " A.a() {}", | 10033 " A.a() {}", |
| 9848 " const factory A.b() = A.a;", | 10034 " const factory A.b() = A.a;", |
| 9849 "}"])); | 10035 "}"])); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10031 } | 10217 } |
| 10032 void test_typeAliasCannotReferenceItself_returnType_indirect() { | 10218 void test_typeAliasCannotReferenceItself_returnType_indirect() { |
| 10033 Source source = addSource(EngineTestCase.createSource(["typedef B A();", "ty
pedef A B();"])); | 10219 Source source = addSource(EngineTestCase.createSource(["typedef B A();", "ty
pedef A B();"])); |
| 10034 resolve(source); | 10220 resolve(source); |
| 10035 assertErrors(source, [ | 10221 assertErrors(source, [ |
| 10036 CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, | 10222 CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, |
| 10037 CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]); | 10223 CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]); |
| 10038 verify([source]); | 10224 verify([source]); |
| 10039 } | 10225 } |
| 10040 void test_typeAliasCannotRereferenceItself_mixin_direct() { | 10226 void test_typeAliasCannotRereferenceItself_mixin_direct() { |
| 10041 Source source = addSource(EngineTestCase.createSource(["typedef M = Object w
ith M;"])); | 10227 Source source = addSource(EngineTestCase.createSource(["class M = Object wit
h M;"])); |
| 10042 resolve(source); | 10228 resolve(source); |
| 10043 assertErrors(source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSEL
F]); | 10229 assertErrors(source, [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSEL
F]); |
| 10044 verify([source]); | 10230 verify([source]); |
| 10045 } | 10231 } |
| 10046 void test_typeAliasCannotRereferenceItself_mixin_indirect() { | 10232 void test_typeAliasCannotRereferenceItself_mixin_indirect() { |
| 10047 Source source = addSource(EngineTestCase.createSource([ | 10233 Source source = addSource(EngineTestCase.createSource([ |
| 10048 "typedef M1 = Object with M2;", | 10234 "class M1 = Object with M2;", |
| 10049 "typedef M2 = Object with M1;"])); | 10235 "class M2 = Object with M1;"])); |
| 10050 resolve(source); | 10236 resolve(source); |
| 10051 assertErrors(source, [ | 10237 assertErrors(source, [ |
| 10052 CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, | 10238 CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, |
| 10053 CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]); | 10239 CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]); |
| 10054 verify([source]); | 10240 verify([source]); |
| 10055 } | 10241 } |
| 10056 void test_typeArgumentNotMatchingBounds_const() { | 10242 void test_typeArgumentNotMatchingBounds_const() { |
| 10057 Source source = addSource(EngineTestCase.createSource([ | 10243 Source source = addSource(EngineTestCase.createSource([ |
| 10058 "class A {}", | 10244 "class A {}", |
| 10059 "class B {}", | 10245 "class B {}", |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10306 runJUnitTest(__test, __test.test_ambiguousExport); | 10492 runJUnitTest(__test, __test.test_ambiguousExport); |
| 10307 }); | 10493 }); |
| 10308 _ut.test('test_ambiguousImport_function', () { | 10494 _ut.test('test_ambiguousImport_function', () { |
| 10309 final __test = new CompileTimeErrorCodeTest(); | 10495 final __test = new CompileTimeErrorCodeTest(); |
| 10310 runJUnitTest(__test, __test.test_ambiguousImport_function); | 10496 runJUnitTest(__test, __test.test_ambiguousImport_function); |
| 10311 }); | 10497 }); |
| 10312 _ut.test('test_argumentDefinitionTestNonParameter', () { | 10498 _ut.test('test_argumentDefinitionTestNonParameter', () { |
| 10313 final __test = new CompileTimeErrorCodeTest(); | 10499 final __test = new CompileTimeErrorCodeTest(); |
| 10314 runJUnitTest(__test, __test.test_argumentDefinitionTestNonParameter); | 10500 runJUnitTest(__test, __test.test_argumentDefinitionTestNonParameter); |
| 10315 }); | 10501 }); |
| 10502 _ut.test('test_builtInIdentifierAsMixinName_classTypeAlias', () { |
| 10503 final __test = new CompileTimeErrorCodeTest(); |
| 10504 runJUnitTest(__test, __test.test_builtInIdentifierAsMixinName_classTypeA
lias); |
| 10505 }); |
| 10316 _ut.test('test_builtInIdentifierAsTypeName', () { | 10506 _ut.test('test_builtInIdentifierAsTypeName', () { |
| 10317 final __test = new CompileTimeErrorCodeTest(); | 10507 final __test = new CompileTimeErrorCodeTest(); |
| 10318 runJUnitTest(__test, __test.test_builtInIdentifierAsTypeName); | 10508 runJUnitTest(__test, __test.test_builtInIdentifierAsTypeName); |
| 10319 }); | 10509 }); |
| 10320 _ut.test('test_builtInIdentifierAsTypeParameterName', () { | 10510 _ut.test('test_builtInIdentifierAsTypeParameterName', () { |
| 10321 final __test = new CompileTimeErrorCodeTest(); | 10511 final __test = new CompileTimeErrorCodeTest(); |
| 10322 runJUnitTest(__test, __test.test_builtInIdentifierAsTypeParameterName); | 10512 runJUnitTest(__test, __test.test_builtInIdentifierAsTypeParameterName); |
| 10323 }); | 10513 }); |
| 10324 _ut.test('test_builtInIdentifierAsType_formalParameter_field', () { | 10514 _ut.test('test_builtInIdentifierAsType_formalParameter_field', () { |
| 10325 final __test = new CompileTimeErrorCodeTest(); | 10515 final __test = new CompileTimeErrorCodeTest(); |
| 10326 runJUnitTest(__test, __test.test_builtInIdentifierAsType_formalParameter
_field); | 10516 runJUnitTest(__test, __test.test_builtInIdentifierAsType_formalParameter
_field); |
| 10327 }); | 10517 }); |
| 10328 _ut.test('test_builtInIdentifierAsType_formalParameter_simple', () { | 10518 _ut.test('test_builtInIdentifierAsType_formalParameter_simple', () { |
| 10329 final __test = new CompileTimeErrorCodeTest(); | 10519 final __test = new CompileTimeErrorCodeTest(); |
| 10330 runJUnitTest(__test, __test.test_builtInIdentifierAsType_formalParameter
_simple); | 10520 runJUnitTest(__test, __test.test_builtInIdentifierAsType_formalParameter
_simple); |
| 10331 }); | 10521 }); |
| 10332 _ut.test('test_builtInIdentifierAsType_variableDeclaration', () { | 10522 _ut.test('test_builtInIdentifierAsType_variableDeclaration', () { |
| 10333 final __test = new CompileTimeErrorCodeTest(); | 10523 final __test = new CompileTimeErrorCodeTest(); |
| 10334 runJUnitTest(__test, __test.test_builtInIdentifierAsType_variableDeclara
tion); | 10524 runJUnitTest(__test, __test.test_builtInIdentifierAsType_variableDeclara
tion); |
| 10335 }); | 10525 }); |
| 10336 _ut.test('test_builtInIdentifierAsTypedefName_classTypeAlias', () { | |
| 10337 final __test = new CompileTimeErrorCodeTest(); | |
| 10338 runJUnitTest(__test, __test.test_builtInIdentifierAsTypedefName_classTyp
eAlias); | |
| 10339 }); | |
| 10340 _ut.test('test_builtInIdentifierAsTypedefName_functionTypeAlias', () { | 10526 _ut.test('test_builtInIdentifierAsTypedefName_functionTypeAlias', () { |
| 10341 final __test = new CompileTimeErrorCodeTest(); | 10527 final __test = new CompileTimeErrorCodeTest(); |
| 10342 runJUnitTest(__test, __test.test_builtInIdentifierAsTypedefName_function
TypeAlias); | 10528 runJUnitTest(__test, __test.test_builtInIdentifierAsTypedefName_function
TypeAlias); |
| 10343 }); | 10529 }); |
| 10344 _ut.test('test_caseExpressionTypeImplementsEquals', () { | 10530 _ut.test('test_caseExpressionTypeImplementsEquals', () { |
| 10345 final __test = new CompileTimeErrorCodeTest(); | 10531 final __test = new CompileTimeErrorCodeTest(); |
| 10346 runJUnitTest(__test, __test.test_caseExpressionTypeImplementsEquals); | 10532 runJUnitTest(__test, __test.test_caseExpressionTypeImplementsEquals); |
| 10347 }); | 10533 }); |
| 10348 _ut.test('test_conflictingConstructorNameAndMember_field', () { | 10534 _ut.test('test_conflictingConstructorNameAndMember_field', () { |
| 10349 final __test = new CompileTimeErrorCodeTest(); | 10535 final __test = new CompileTimeErrorCodeTest(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 10362 runJUnitTest(__test, __test.test_conflictingGetterAndMethod_getter_metho
d); | 10548 runJUnitTest(__test, __test.test_conflictingGetterAndMethod_getter_metho
d); |
| 10363 }); | 10549 }); |
| 10364 _ut.test('test_conflictingGetterAndMethod_method_field', () { | 10550 _ut.test('test_conflictingGetterAndMethod_method_field', () { |
| 10365 final __test = new CompileTimeErrorCodeTest(); | 10551 final __test = new CompileTimeErrorCodeTest(); |
| 10366 runJUnitTest(__test, __test.test_conflictingGetterAndMethod_method_field
); | 10552 runJUnitTest(__test, __test.test_conflictingGetterAndMethod_method_field
); |
| 10367 }); | 10553 }); |
| 10368 _ut.test('test_conflictingGetterAndMethod_method_getter', () { | 10554 _ut.test('test_conflictingGetterAndMethod_method_getter', () { |
| 10369 final __test = new CompileTimeErrorCodeTest(); | 10555 final __test = new CompileTimeErrorCodeTest(); |
| 10370 runJUnitTest(__test, __test.test_conflictingGetterAndMethod_method_gette
r); | 10556 runJUnitTest(__test, __test.test_conflictingGetterAndMethod_method_gette
r); |
| 10371 }); | 10557 }); |
| 10558 _ut.test('test_conflictingTypeVariableAndClass', () { |
| 10559 final __test = new CompileTimeErrorCodeTest(); |
| 10560 runJUnitTest(__test, __test.test_conflictingTypeVariableAndClass); |
| 10561 }); |
| 10562 _ut.test('test_conflictingTypeVariableAndMember_field', () { |
| 10563 final __test = new CompileTimeErrorCodeTest(); |
| 10564 runJUnitTest(__test, __test.test_conflictingTypeVariableAndMember_field)
; |
| 10565 }); |
| 10566 _ut.test('test_conflictingTypeVariableAndMember_getter', () { |
| 10567 final __test = new CompileTimeErrorCodeTest(); |
| 10568 runJUnitTest(__test, __test.test_conflictingTypeVariableAndMember_getter
); |
| 10569 }); |
| 10570 _ut.test('test_conflictingTypeVariableAndMember_method', () { |
| 10571 final __test = new CompileTimeErrorCodeTest(); |
| 10572 runJUnitTest(__test, __test.test_conflictingTypeVariableAndMember_method
); |
| 10573 }); |
| 10574 _ut.test('test_conflictingTypeVariableAndMember_method_static', () { |
| 10575 final __test = new CompileTimeErrorCodeTest(); |
| 10576 runJUnitTest(__test, __test.test_conflictingTypeVariableAndMember_method
_static); |
| 10577 }); |
| 10578 _ut.test('test_conflictingTypeVariableAndMember_setter', () { |
| 10579 final __test = new CompileTimeErrorCodeTest(); |
| 10580 runJUnitTest(__test, __test.test_conflictingTypeVariableAndMember_setter
); |
| 10581 }); |
| 10372 _ut.test('test_constConstructorWithNonConstSuper_explicit', () { | 10582 _ut.test('test_constConstructorWithNonConstSuper_explicit', () { |
| 10373 final __test = new CompileTimeErrorCodeTest(); | 10583 final __test = new CompileTimeErrorCodeTest(); |
| 10374 runJUnitTest(__test, __test.test_constConstructorWithNonConstSuper_expli
cit); | 10584 runJUnitTest(__test, __test.test_constConstructorWithNonConstSuper_expli
cit); |
| 10375 }); | 10585 }); |
| 10376 _ut.test('test_constConstructorWithNonConstSuper_implicit', () { | 10586 _ut.test('test_constConstructorWithNonConstSuper_implicit', () { |
| 10377 final __test = new CompileTimeErrorCodeTest(); | 10587 final __test = new CompileTimeErrorCodeTest(); |
| 10378 runJUnitTest(__test, __test.test_constConstructorWithNonConstSuper_impli
cit); | 10588 runJUnitTest(__test, __test.test_constConstructorWithNonConstSuper_impli
cit); |
| 10379 }); | 10589 }); |
| 10380 _ut.test('test_constConstructorWithNonFinalField_mixin', () { | 10590 _ut.test('test_constConstructorWithNonFinalField_mixin', () { |
| 10381 final __test = new CompileTimeErrorCodeTest(); | 10591 final __test = new CompileTimeErrorCodeTest(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10466 runJUnitTest(__test, __test.test_constInitializedWithNonConstValue_missi
ngConstInListLiteral); | 10676 runJUnitTest(__test, __test.test_constInitializedWithNonConstValue_missi
ngConstInListLiteral); |
| 10467 }); | 10677 }); |
| 10468 _ut.test('test_constInitializedWithNonConstValue_missingConstInMapLiteral'
, () { | 10678 _ut.test('test_constInitializedWithNonConstValue_missingConstInMapLiteral'
, () { |
| 10469 final __test = new CompileTimeErrorCodeTest(); | 10679 final __test = new CompileTimeErrorCodeTest(); |
| 10470 runJUnitTest(__test, __test.test_constInitializedWithNonConstValue_missi
ngConstInMapLiteral); | 10680 runJUnitTest(__test, __test.test_constInitializedWithNonConstValue_missi
ngConstInMapLiteral); |
| 10471 }); | 10681 }); |
| 10472 _ut.test('test_constInstanceField', () { | 10682 _ut.test('test_constInstanceField', () { |
| 10473 final __test = new CompileTimeErrorCodeTest(); | 10683 final __test = new CompileTimeErrorCodeTest(); |
| 10474 runJUnitTest(__test, __test.test_constInstanceField); | 10684 runJUnitTest(__test, __test.test_constInstanceField); |
| 10475 }); | 10685 }); |
| 10686 _ut.test('test_constMapKeyTypeImplementsEquals_direct', () { |
| 10687 final __test = new CompileTimeErrorCodeTest(); |
| 10688 runJUnitTest(__test, __test.test_constMapKeyTypeImplementsEquals_direct)
; |
| 10689 }); |
| 10690 _ut.test('test_constMapKeyTypeImplementsEquals_super', () { |
| 10691 final __test = new CompileTimeErrorCodeTest(); |
| 10692 runJUnitTest(__test, __test.test_constMapKeyTypeImplementsEquals_super); |
| 10693 }); |
| 10476 _ut.test('test_constWithInvalidTypeParameters', () { | 10694 _ut.test('test_constWithInvalidTypeParameters', () { |
| 10477 final __test = new CompileTimeErrorCodeTest(); | 10695 final __test = new CompileTimeErrorCodeTest(); |
| 10478 runJUnitTest(__test, __test.test_constWithInvalidTypeParameters); | 10696 runJUnitTest(__test, __test.test_constWithInvalidTypeParameters); |
| 10479 }); | 10697 }); |
| 10480 _ut.test('test_constWithInvalidTypeParameters_tooFew', () { | 10698 _ut.test('test_constWithInvalidTypeParameters_tooFew', () { |
| 10481 final __test = new CompileTimeErrorCodeTest(); | 10699 final __test = new CompileTimeErrorCodeTest(); |
| 10482 runJUnitTest(__test, __test.test_constWithInvalidTypeParameters_tooFew); | 10700 runJUnitTest(__test, __test.test_constWithInvalidTypeParameters_tooFew); |
| 10483 }); | 10701 }); |
| 10484 _ut.test('test_constWithInvalidTypeParameters_tooMany', () { | 10702 _ut.test('test_constWithInvalidTypeParameters_tooMany', () { |
| 10485 final __test = new CompileTimeErrorCodeTest(); | 10703 final __test = new CompileTimeErrorCodeTest(); |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10746 runJUnitTest(__test, __test.test_implementsDisallowedClass_num); | 10964 runJUnitTest(__test, __test.test_implementsDisallowedClass_num); |
| 10747 }); | 10965 }); |
| 10748 _ut.test('test_implementsDynamic', () { | 10966 _ut.test('test_implementsDynamic', () { |
| 10749 final __test = new CompileTimeErrorCodeTest(); | 10967 final __test = new CompileTimeErrorCodeTest(); |
| 10750 runJUnitTest(__test, __test.test_implementsDynamic); | 10968 runJUnitTest(__test, __test.test_implementsDynamic); |
| 10751 }); | 10969 }); |
| 10752 _ut.test('test_implementsNonClass_class', () { | 10970 _ut.test('test_implementsNonClass_class', () { |
| 10753 final __test = new CompileTimeErrorCodeTest(); | 10971 final __test = new CompileTimeErrorCodeTest(); |
| 10754 runJUnitTest(__test, __test.test_implementsNonClass_class); | 10972 runJUnitTest(__test, __test.test_implementsNonClass_class); |
| 10755 }); | 10973 }); |
| 10756 _ut.test('test_implementsNonClass_typedef', () { | 10974 _ut.test('test_implementsNonClass_typeAlias', () { |
| 10757 final __test = new CompileTimeErrorCodeTest(); | 10975 final __test = new CompileTimeErrorCodeTest(); |
| 10758 runJUnitTest(__test, __test.test_implementsNonClass_typedef); | 10976 runJUnitTest(__test, __test.test_implementsNonClass_typeAlias); |
| 10759 }); | 10977 }); |
| 10760 _ut.test('test_implementsRepeated', () { | 10978 _ut.test('test_implementsRepeated', () { |
| 10761 final __test = new CompileTimeErrorCodeTest(); | 10979 final __test = new CompileTimeErrorCodeTest(); |
| 10762 runJUnitTest(__test, __test.test_implementsRepeated); | 10980 runJUnitTest(__test, __test.test_implementsRepeated); |
| 10763 }); | 10981 }); |
| 10764 _ut.test('test_implementsRepeated_3times', () { | 10982 _ut.test('test_implementsRepeated_3times', () { |
| 10765 final __test = new CompileTimeErrorCodeTest(); | 10983 final __test = new CompileTimeErrorCodeTest(); |
| 10766 runJUnitTest(__test, __test.test_implementsRepeated_3times); | 10984 runJUnitTest(__test, __test.test_implementsRepeated_3times); |
| 10767 }); | 10985 }); |
| 10768 _ut.test('test_implementsSuperClass', () { | 10986 _ut.test('test_implementsSuperClass', () { |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10994 runJUnitTest(__test, __test.test_memberWithClassName_method); | 11212 runJUnitTest(__test, __test.test_memberWithClassName_method); |
| 10995 }); | 11213 }); |
| 10996 _ut.test('test_methodAndGetterWithSameName', () { | 11214 _ut.test('test_methodAndGetterWithSameName', () { |
| 10997 final __test = new CompileTimeErrorCodeTest(); | 11215 final __test = new CompileTimeErrorCodeTest(); |
| 10998 runJUnitTest(__test, __test.test_methodAndGetterWithSameName); | 11216 runJUnitTest(__test, __test.test_methodAndGetterWithSameName); |
| 10999 }); | 11217 }); |
| 11000 _ut.test('test_mixinDeclaresConstructor_classDeclaration', () { | 11218 _ut.test('test_mixinDeclaresConstructor_classDeclaration', () { |
| 11001 final __test = new CompileTimeErrorCodeTest(); | 11219 final __test = new CompileTimeErrorCodeTest(); |
| 11002 runJUnitTest(__test, __test.test_mixinDeclaresConstructor_classDeclarati
on); | 11220 runJUnitTest(__test, __test.test_mixinDeclaresConstructor_classDeclarati
on); |
| 11003 }); | 11221 }); |
| 11004 _ut.test('test_mixinDeclaresConstructor_typedef', () { | 11222 _ut.test('test_mixinDeclaresConstructor_typeAlias', () { |
| 11005 final __test = new CompileTimeErrorCodeTest(); | 11223 final __test = new CompileTimeErrorCodeTest(); |
| 11006 runJUnitTest(__test, __test.test_mixinDeclaresConstructor_typedef); | 11224 runJUnitTest(__test, __test.test_mixinDeclaresConstructor_typeAlias); |
| 11007 }); | 11225 }); |
| 11008 _ut.test('test_mixinInheritsFromNotObject_classDeclaration_extends', () { | 11226 _ut.test('test_mixinInheritsFromNotObject_classDeclaration_extends', () { |
| 11009 final __test = new CompileTimeErrorCodeTest(); | 11227 final __test = new CompileTimeErrorCodeTest(); |
| 11010 runJUnitTest(__test, __test.test_mixinInheritsFromNotObject_classDeclara
tion_extends); | 11228 runJUnitTest(__test, __test.test_mixinInheritsFromNotObject_classDeclara
tion_extends); |
| 11011 }); | 11229 }); |
| 11012 _ut.test('test_mixinInheritsFromNotObject_classDeclaration_with', () { | 11230 _ut.test('test_mixinInheritsFromNotObject_classDeclaration_with', () { |
| 11013 final __test = new CompileTimeErrorCodeTest(); | 11231 final __test = new CompileTimeErrorCodeTest(); |
| 11014 runJUnitTest(__test, __test.test_mixinInheritsFromNotObject_classDeclara
tion_with); | 11232 runJUnitTest(__test, __test.test_mixinInheritsFromNotObject_classDeclara
tion_with); |
| 11015 }); | 11233 }); |
| 11016 _ut.test('test_mixinInheritsFromNotObject_typedef_extends', () { | 11234 _ut.test('test_mixinInheritsFromNotObject_typeAlias_extends', () { |
| 11017 final __test = new CompileTimeErrorCodeTest(); | 11235 final __test = new CompileTimeErrorCodeTest(); |
| 11018 runJUnitTest(__test, __test.test_mixinInheritsFromNotObject_typedef_exte
nds); | 11236 runJUnitTest(__test, __test.test_mixinInheritsFromNotObject_typeAlias_ex
tends); |
| 11019 }); | 11237 }); |
| 11020 _ut.test('test_mixinInheritsFromNotObject_typedef_with', () { | 11238 _ut.test('test_mixinInheritsFromNotObject_typeAlias_with', () { |
| 11021 final __test = new CompileTimeErrorCodeTest(); | 11239 final __test = new CompileTimeErrorCodeTest(); |
| 11022 runJUnitTest(__test, __test.test_mixinInheritsFromNotObject_typedef_with
); | 11240 runJUnitTest(__test, __test.test_mixinInheritsFromNotObject_typeAlias_wi
th); |
| 11023 }); | 11241 }); |
| 11024 _ut.test('test_mixinOfDisallowedClass_Null', () { | 11242 _ut.test('test_mixinOfDisallowedClass_Null', () { |
| 11025 final __test = new CompileTimeErrorCodeTest(); | 11243 final __test = new CompileTimeErrorCodeTest(); |
| 11026 runJUnitTest(__test, __test.test_mixinOfDisallowedClass_Null); | 11244 runJUnitTest(__test, __test.test_mixinOfDisallowedClass_Null); |
| 11027 }); | 11245 }); |
| 11028 _ut.test('test_mixinOfDisallowedClass_String', () { | 11246 _ut.test('test_mixinOfDisallowedClass_String', () { |
| 11029 final __test = new CompileTimeErrorCodeTest(); | 11247 final __test = new CompileTimeErrorCodeTest(); |
| 11030 runJUnitTest(__test, __test.test_mixinOfDisallowedClass_String); | 11248 runJUnitTest(__test, __test.test_mixinOfDisallowedClass_String); |
| 11031 }); | 11249 }); |
| 11032 _ut.test('test_mixinOfDisallowedClass_bool', () { | 11250 _ut.test('test_mixinOfDisallowedClass_bool', () { |
| 11033 final __test = new CompileTimeErrorCodeTest(); | 11251 final __test = new CompileTimeErrorCodeTest(); |
| 11034 runJUnitTest(__test, __test.test_mixinOfDisallowedClass_bool); | 11252 runJUnitTest(__test, __test.test_mixinOfDisallowedClass_bool); |
| 11035 }); | 11253 }); |
| 11036 _ut.test('test_mixinOfDisallowedClass_double', () { | 11254 _ut.test('test_mixinOfDisallowedClass_double', () { |
| 11037 final __test = new CompileTimeErrorCodeTest(); | 11255 final __test = new CompileTimeErrorCodeTest(); |
| 11038 runJUnitTest(__test, __test.test_mixinOfDisallowedClass_double); | 11256 runJUnitTest(__test, __test.test_mixinOfDisallowedClass_double); |
| 11039 }); | 11257 }); |
| 11040 _ut.test('test_mixinOfDisallowedClass_int', () { | 11258 _ut.test('test_mixinOfDisallowedClass_int', () { |
| 11041 final __test = new CompileTimeErrorCodeTest(); | 11259 final __test = new CompileTimeErrorCodeTest(); |
| 11042 runJUnitTest(__test, __test.test_mixinOfDisallowedClass_int); | 11260 runJUnitTest(__test, __test.test_mixinOfDisallowedClass_int); |
| 11043 }); | 11261 }); |
| 11044 _ut.test('test_mixinOfDisallowedClass_num', () { | 11262 _ut.test('test_mixinOfDisallowedClass_num', () { |
| 11045 final __test = new CompileTimeErrorCodeTest(); | 11263 final __test = new CompileTimeErrorCodeTest(); |
| 11046 runJUnitTest(__test, __test.test_mixinOfDisallowedClass_num); | 11264 runJUnitTest(__test, __test.test_mixinOfDisallowedClass_num); |
| 11047 }); | 11265 }); |
| 11048 _ut.test('test_mixinOfNonClass_class', () { | 11266 _ut.test('test_mixinOfNonClass_class', () { |
| 11049 final __test = new CompileTimeErrorCodeTest(); | 11267 final __test = new CompileTimeErrorCodeTest(); |
| 11050 runJUnitTest(__test, __test.test_mixinOfNonClass_class); | 11268 runJUnitTest(__test, __test.test_mixinOfNonClass_class); |
| 11051 }); | 11269 }); |
| 11052 _ut.test('test_mixinOfNonClass_typedef', () { | 11270 _ut.test('test_mixinOfNonClass_typeAlias', () { |
| 11053 final __test = new CompileTimeErrorCodeTest(); | 11271 final __test = new CompileTimeErrorCodeTest(); |
| 11054 runJUnitTest(__test, __test.test_mixinOfNonClass_typedef); | 11272 runJUnitTest(__test, __test.test_mixinOfNonClass_typeAlias); |
| 11055 }); | 11273 }); |
| 11056 _ut.test('test_mixinReferencesSuper', () { | 11274 _ut.test('test_mixinReferencesSuper', () { |
| 11057 final __test = new CompileTimeErrorCodeTest(); | 11275 final __test = new CompileTimeErrorCodeTest(); |
| 11058 runJUnitTest(__test, __test.test_mixinReferencesSuper); | 11276 runJUnitTest(__test, __test.test_mixinReferencesSuper); |
| 11059 }); | 11277 }); |
| 11060 _ut.test('test_mixinWithNonClassSuperclass_class', () { | 11278 _ut.test('test_mixinWithNonClassSuperclass_class', () { |
| 11061 final __test = new CompileTimeErrorCodeTest(); | 11279 final __test = new CompileTimeErrorCodeTest(); |
| 11062 runJUnitTest(__test, __test.test_mixinWithNonClassSuperclass_class); | 11280 runJUnitTest(__test, __test.test_mixinWithNonClassSuperclass_class); |
| 11063 }); | 11281 }); |
| 11064 _ut.test('test_mixinWithNonClassSuperclass_typedef', () { | 11282 _ut.test('test_mixinWithNonClassSuperclass_typeAlias', () { |
| 11065 final __test = new CompileTimeErrorCodeTest(); | 11283 final __test = new CompileTimeErrorCodeTest(); |
| 11066 runJUnitTest(__test, __test.test_mixinWithNonClassSuperclass_typedef); | 11284 runJUnitTest(__test, __test.test_mixinWithNonClassSuperclass_typeAlias); |
| 11067 }); | 11285 }); |
| 11068 _ut.test('test_multipleRedirectingConstructorInvocations', () { | 11286 _ut.test('test_multipleRedirectingConstructorInvocations', () { |
| 11069 final __test = new CompileTimeErrorCodeTest(); | 11287 final __test = new CompileTimeErrorCodeTest(); |
| 11070 runJUnitTest(__test, __test.test_multipleRedirectingConstructorInvocatio
ns); | 11288 runJUnitTest(__test, __test.test_multipleRedirectingConstructorInvocatio
ns); |
| 11071 }); | 11289 }); |
| 11072 _ut.test('test_multipleSuperInitializers', () { | 11290 _ut.test('test_multipleSuperInitializers', () { |
| 11073 final __test = new CompileTimeErrorCodeTest(); | 11291 final __test = new CompileTimeErrorCodeTest(); |
| 11074 runJUnitTest(__test, __test.test_multipleSuperInitializers); | 11292 runJUnitTest(__test, __test.test_multipleSuperInitializers); |
| 11075 }); | 11293 }); |
| 11076 _ut.test('test_nativeClauseInNonSDKCode', () { | 11294 _ut.test('test_nativeClauseInNonSDKCode', () { |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11274 runJUnitTest(__test, __test.test_recursiveFactoryRedirect_outsideCycle); | 11492 runJUnitTest(__test, __test.test_recursiveFactoryRedirect_outsideCycle); |
| 11275 }); | 11493 }); |
| 11276 _ut.test('test_recursiveInterfaceInheritanceBaseCaseExtends', () { | 11494 _ut.test('test_recursiveInterfaceInheritanceBaseCaseExtends', () { |
| 11277 final __test = new CompileTimeErrorCodeTest(); | 11495 final __test = new CompileTimeErrorCodeTest(); |
| 11278 runJUnitTest(__test, __test.test_recursiveInterfaceInheritanceBaseCaseEx
tends); | 11496 runJUnitTest(__test, __test.test_recursiveInterfaceInheritanceBaseCaseEx
tends); |
| 11279 }); | 11497 }); |
| 11280 _ut.test('test_recursiveInterfaceInheritanceBaseCaseImplements', () { | 11498 _ut.test('test_recursiveInterfaceInheritanceBaseCaseImplements', () { |
| 11281 final __test = new CompileTimeErrorCodeTest(); | 11499 final __test = new CompileTimeErrorCodeTest(); |
| 11282 runJUnitTest(__test, __test.test_recursiveInterfaceInheritanceBaseCaseIm
plements); | 11500 runJUnitTest(__test, __test.test_recursiveInterfaceInheritanceBaseCaseIm
plements); |
| 11283 }); | 11501 }); |
| 11284 _ut.test('test_recursiveInterfaceInheritanceBaseCaseImplements_typedef', (
) { | 11502 _ut.test('test_recursiveInterfaceInheritanceBaseCaseImplements_typeAlias',
() { |
| 11285 final __test = new CompileTimeErrorCodeTest(); | 11503 final __test = new CompileTimeErrorCodeTest(); |
| 11286 runJUnitTest(__test, __test.test_recursiveInterfaceInheritanceBaseCaseIm
plements_typedef); | 11504 runJUnitTest(__test, __test.test_recursiveInterfaceInheritanceBaseCaseIm
plements_typeAlias); |
| 11287 }); | 11505 }); |
| 11288 _ut.test('test_recursiveInterfaceInheritance_extends', () { | 11506 _ut.test('test_recursiveInterfaceInheritance_extends', () { |
| 11289 final __test = new CompileTimeErrorCodeTest(); | 11507 final __test = new CompileTimeErrorCodeTest(); |
| 11290 runJUnitTest(__test, __test.test_recursiveInterfaceInheritance_extends); | 11508 runJUnitTest(__test, __test.test_recursiveInterfaceInheritance_extends); |
| 11291 }); | 11509 }); |
| 11292 _ut.test('test_recursiveInterfaceInheritance_extends_implements', () { | 11510 _ut.test('test_recursiveInterfaceInheritance_extends_implements', () { |
| 11293 final __test = new CompileTimeErrorCodeTest(); | 11511 final __test = new CompileTimeErrorCodeTest(); |
| 11294 runJUnitTest(__test, __test.test_recursiveInterfaceInheritance_extends_i
mplements); | 11512 runJUnitTest(__test, __test.test_recursiveInterfaceInheritance_extends_i
mplements); |
| 11295 }); | 11513 }); |
| 11296 _ut.test('test_recursiveInterfaceInheritance_implements', () { | 11514 _ut.test('test_recursiveInterfaceInheritance_implements', () { |
| (...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12794 runJUnitTest(__test, __test.test_import_valid_inside_lib2); | 13012 runJUnitTest(__test, __test.test_import_valid_inside_lib2); |
| 12795 }); | 13013 }); |
| 12796 _ut.test('test_import_valid_outside_lib', () { | 13014 _ut.test('test_import_valid_outside_lib', () { |
| 12797 final __test = new PubSuggestionCodeTest(); | 13015 final __test = new PubSuggestionCodeTest(); |
| 12798 runJUnitTest(__test, __test.test_import_valid_outside_lib); | 13016 runJUnitTest(__test, __test.test_import_valid_outside_lib); |
| 12799 }); | 13017 }); |
| 12800 }); | 13018 }); |
| 12801 } | 13019 } |
| 12802 } | 13020 } |
| 12803 class StaticWarningCodeTest extends ResolverTestCase { | 13021 class StaticWarningCodeTest extends ResolverTestCase { |
| 12804 void fail_argumentTypeNotAssignable_invocation_functionParameter_generic() { | |
| 12805 Source source = addSource(EngineTestCase.createSource([ | |
| 12806 "class A<K, V> {", | |
| 12807 " m(f(K k), V v) {", | |
| 12808 " f(v);", | |
| 12809 " }", | |
| 12810 "}"])); | |
| 12811 resolve(source); | |
| 12812 assertErrors(source, [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]); | |
| 12813 verify([source]); | |
| 12814 } | |
| 12815 void fail_commentReferenceConstructorNotVisible() { | 13022 void fail_commentReferenceConstructorNotVisible() { |
| 12816 Source source = addSource(EngineTestCase.createSource([])); | 13023 Source source = addSource(EngineTestCase.createSource([])); |
| 12817 resolve(source); | 13024 resolve(source); |
| 12818 assertErrors(source, [StaticWarningCode.COMMENT_REFERENCE_CONSTRUCTOR_NOT_VI
SIBLE]); | 13025 assertErrors(source, [StaticWarningCode.COMMENT_REFERENCE_CONSTRUCTOR_NOT_VI
SIBLE]); |
| 12819 verify([source]); | 13026 verify([source]); |
| 12820 } | 13027 } |
| 12821 void fail_commentReferenceIdentifierNotVisible() { | 13028 void fail_commentReferenceIdentifierNotVisible() { |
| 12822 Source source = addSource(EngineTestCase.createSource([])); | 13029 Source source = addSource(EngineTestCase.createSource([])); |
| 12823 resolve(source); | 13030 resolve(source); |
| 12824 assertErrors(source, [StaticWarningCode.COMMENT_REFERENCE_IDENTIFIER_NOT_VIS
IBLE]); | 13031 assertErrors(source, [StaticWarningCode.COMMENT_REFERENCE_IDENTIFIER_NOT_VIS
IBLE]); |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13141 resolve(source); | 13348 resolve(source); |
| 13142 assertErrors(source, [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]); | 13349 assertErrors(source, [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]); |
| 13143 verify([source]); | 13350 verify([source]); |
| 13144 } | 13351 } |
| 13145 void test_argumentTypeNotAssignable_invocation_functionParameter() { | 13352 void test_argumentTypeNotAssignable_invocation_functionParameter() { |
| 13146 Source source = addSource(EngineTestCase.createSource(["a(b(int p)) {", " b
('0');", "}"])); | 13353 Source source = addSource(EngineTestCase.createSource(["a(b(int p)) {", " b
('0');", "}"])); |
| 13147 resolve(source); | 13354 resolve(source); |
| 13148 assertErrors(source, [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]); | 13355 assertErrors(source, [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]); |
| 13149 verify([source]); | 13356 verify([source]); |
| 13150 } | 13357 } |
| 13358 void test_argumentTypeNotAssignable_invocation_functionParameter_generic() { |
| 13359 Source source = addSource(EngineTestCase.createSource([ |
| 13360 "class A<K, V> {", |
| 13361 " m(f(K k), V v) {", |
| 13362 " f(v);", |
| 13363 " }", |
| 13364 "}"])); |
| 13365 resolve(source); |
| 13366 assertErrors(source, [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]); |
| 13367 verify([source]); |
| 13368 } |
| 13151 void test_argumentTypeNotAssignable_invocation_functionTypes_optional() { | 13369 void test_argumentTypeNotAssignable_invocation_functionTypes_optional() { |
| 13152 Source source = addSource(EngineTestCase.createSource([ | 13370 Source source = addSource(EngineTestCase.createSource([ |
| 13153 "void acceptFunNumOptBool(void funNumOptBool([bool b])) {}", | 13371 "void acceptFunNumOptBool(void funNumOptBool([bool b])) {}", |
| 13154 "void funNumBool(bool b) {}", | 13372 "void funNumBool(bool b) {}", |
| 13155 "main() {", | 13373 "main() {", |
| 13156 " acceptFunNumOptBool(funNumBool);", | 13374 " acceptFunNumOptBool(funNumBool);", |
| 13157 "}"])); | 13375 "}"])); |
| 13158 resolve(source); | 13376 resolve(source); |
| 13159 assertErrors(source, [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]); | 13377 assertErrors(source, [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]); |
| 13160 verify([source]); | 13378 verify([source]); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13260 resolve(source); | 13478 resolve(source); |
| 13261 assertErrors(source, [StaticWarningCode.ASSIGNMENT_TO_CONST]); | 13479 assertErrors(source, [StaticWarningCode.ASSIGNMENT_TO_CONST]); |
| 13262 verify([source]); | 13480 verify([source]); |
| 13263 } | 13481 } |
| 13264 void test_assignmentToConst_localVariable() { | 13482 void test_assignmentToConst_localVariable() { |
| 13265 Source source = addSource(EngineTestCase.createSource(["f() {", " const x =
0;", " x = 1;", "}"])); | 13483 Source source = addSource(EngineTestCase.createSource(["f() {", " const x =
0;", " x = 1;", "}"])); |
| 13266 resolve(source); | 13484 resolve(source); |
| 13267 assertErrors(source, [StaticWarningCode.ASSIGNMENT_TO_CONST]); | 13485 assertErrors(source, [StaticWarningCode.ASSIGNMENT_TO_CONST]); |
| 13268 verify([source]); | 13486 verify([source]); |
| 13269 } | 13487 } |
| 13488 void test_assignmentToFinal_excludedSetter() { |
| 13489 Source source = addSource(EngineTestCase.createSource([ |
| 13490 "class A {", |
| 13491 " var v;", |
| 13492 "}", |
| 13493 "class B extends A {", |
| 13494 " final v = 0;", |
| 13495 "}", |
| 13496 "main() {", |
| 13497 " new B().v = 1;", |
| 13498 "}"])); |
| 13499 resolve(source); |
| 13500 assertErrors(source, [StaticWarningCode.ASSIGNMENT_TO_FINAL]); |
| 13501 verify([source]); |
| 13502 } |
| 13270 void test_assignmentToFinal_instanceVariable() { | 13503 void test_assignmentToFinal_instanceVariable() { |
| 13271 Source source = addSource(EngineTestCase.createSource([ | 13504 Source source = addSource(EngineTestCase.createSource([ |
| 13272 "class A {", | 13505 "class A {", |
| 13273 " final v = 0;", | 13506 " final v = 0;", |
| 13274 "}", | 13507 "}", |
| 13275 "f() {", | 13508 "f() {", |
| 13276 " A a = new A();", | 13509 " A a = new A();", |
| 13277 " a.v = 1;", | 13510 " a.v = 1;", |
| 13278 "}"])); | 13511 "}"])); |
| 13279 resolve(source); | 13512 resolve(source); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13362 resolve(source); | 13595 resolve(source); |
| 13363 assertErrors(source, [StaticWarningCode.CAST_TO_NON_TYPE]); | 13596 assertErrors(source, [StaticWarningCode.CAST_TO_NON_TYPE]); |
| 13364 verify([source]); | 13597 verify([source]); |
| 13365 } | 13598 } |
| 13366 void test_concreteClassWithAbstractMember() { | 13599 void test_concreteClassWithAbstractMember() { |
| 13367 Source source = addSource(EngineTestCase.createSource(["class A {", " m();"
, "}"])); | 13600 Source source = addSource(EngineTestCase.createSource(["class A {", " m();"
, "}"])); |
| 13368 resolve(source); | 13601 resolve(source); |
| 13369 assertErrors(source, [StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER]
); | 13602 assertErrors(source, [StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER]
); |
| 13370 verify([source]); | 13603 verify([source]); |
| 13371 } | 13604 } |
| 13605 void test_conflictingDartImport() { |
| 13606 Source source = addSource(EngineTestCase.createSource([ |
| 13607 "import 'lib.dart';", |
| 13608 "import 'dart:async';", |
| 13609 "Future f = null;", |
| 13610 "Stream s;"])); |
| 13611 addSource2("/lib.dart", EngineTestCase.createSource(["library lib;", "class
Future {}"])); |
| 13612 resolve(source); |
| 13613 assertErrors(source, [StaticWarningCode.CONFLICTING_DART_IMPORT]); |
| 13614 } |
| 13372 void test_conflictingInstanceGetterAndSuperclassMember_direct_field() { | 13615 void test_conflictingInstanceGetterAndSuperclassMember_direct_field() { |
| 13373 Source source = addSource(EngineTestCase.createSource([ | 13616 Source source = addSource(EngineTestCase.createSource([ |
| 13374 "class A {", | 13617 "class A {", |
| 13375 " static int v;", | 13618 " static int v;", |
| 13376 "}", | 13619 "}", |
| 13377 "class B extends A {", | 13620 "class B extends A {", |
| 13378 " get v => 0;", | 13621 " get v => 0;", |
| 13379 "}"])); | 13622 "}"])); |
| 13380 resolve(source); | 13623 resolve(source); |
| 13381 assertErrors(source, [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPE
RCLASS_MEMBER]); | 13624 assertErrors(source, [StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPE
RCLASS_MEMBER]); |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13924 "class A {", | 14167 "class A {", |
| 13925 " m({a, b}) {}", | 14168 " m({a, b}) {}", |
| 13926 "}", | 14169 "}", |
| 13927 "class B extends A {", | 14170 "class B extends A {", |
| 13928 " m({a, c}) {}", | 14171 " m({a, c}) {}", |
| 13929 "}"])); | 14172 "}"])); |
| 13930 resolve(source); | 14173 resolve(source); |
| 13931 assertErrors(source, [StaticWarningCode.INVALID_OVERRIDE_NAMED]); | 14174 assertErrors(source, [StaticWarningCode.INVALID_OVERRIDE_NAMED]); |
| 13932 verify([source]); | 14175 verify([source]); |
| 13933 } | 14176 } |
| 13934 void test_invalidOverridePositional() { | 14177 void test_invalidOverridePositional_optional() { |
| 13935 Source source = addSource(EngineTestCase.createSource([ | 14178 Source source = addSource(EngineTestCase.createSource([ |
| 13936 "class A {", | 14179 "class A {", |
| 13937 " m([a, b]) {}", | 14180 " m([a, b]) {}", |
| 13938 "}", | 14181 "}", |
| 13939 "class B extends A {", | 14182 "class B extends A {", |
| 13940 " m([a]) {}", | 14183 " m([a]) {}", |
| 13941 "}"])); | 14184 "}"])); |
| 13942 resolve(source); | 14185 resolve(source); |
| 13943 assertErrors(source, [StaticWarningCode.INVALID_OVERRIDE_POSITIONAL]); | 14186 assertErrors(source, [StaticWarningCode.INVALID_OVERRIDE_POSITIONAL]); |
| 13944 verify([source]); | 14187 verify([source]); |
| 13945 } | 14188 } |
| 14189 void test_invalidOverridePositional_optionalAndRequired() { |
| 14190 Source source = addSource(EngineTestCase.createSource([ |
| 14191 "class A {", |
| 14192 " m(a, b, [c, d]) {}", |
| 14193 "}", |
| 14194 "class B extends A {", |
| 14195 " m(a, b, [c]) {}", |
| 14196 "}"])); |
| 14197 resolve(source); |
| 14198 assertErrors(source, [StaticWarningCode.INVALID_OVERRIDE_POSITIONAL]); |
| 14199 verify([source]); |
| 14200 } |
| 14201 void test_invalidOverridePositional_optionalAndRequired2() { |
| 14202 Source source = addSource(EngineTestCase.createSource([ |
| 14203 "class A {", |
| 14204 " m(a, b, [c, d]) {}", |
| 14205 "}", |
| 14206 "class B extends A {", |
| 14207 " m(a, [c, d]) {}", |
| 14208 "}"])); |
| 14209 resolve(source); |
| 14210 assertErrors(source, [StaticWarningCode.INVALID_OVERRIDE_POSITIONAL]); |
| 14211 verify([source]); |
| 14212 } |
| 13946 void test_invalidOverrideRequired() { | 14213 void test_invalidOverrideRequired() { |
| 13947 Source source = addSource(EngineTestCase.createSource([ | 14214 Source source = addSource(EngineTestCase.createSource([ |
| 13948 "class A {", | 14215 "class A {", |
| 13949 " m(a) {}", | 14216 " m(a) {}", |
| 13950 "}", | 14217 "}", |
| 13951 "class B extends A {", | 14218 "class B extends A {", |
| 13952 " m(a, b) {}", | 14219 " m(a, b) {}", |
| 13953 "}"])); | 14220 "}"])); |
| 13954 resolve(source); | 14221 resolve(source); |
| 13955 assertErrors(source, [StaticWarningCode.INVALID_OVERRIDE_REQUIRED]); | 14222 assertErrors(source, [StaticWarningCode.INVALID_OVERRIDE_REQUIRED]); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14161 "}", | 14428 "}", |
| 14162 "abstract class B {", | 14429 "abstract class B {", |
| 14163 " int x(int a, [int b]);", | 14430 " int x(int a, [int b]);", |
| 14164 "}", | 14431 "}", |
| 14165 "class C implements A, B {", | 14432 "class C implements A, B {", |
| 14166 "}"])); | 14433 "}"])); |
| 14167 resolve(source); | 14434 resolve(source); |
| 14168 assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT
_MEMBER_ONE]); | 14435 assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT
_MEMBER_ONE]); |
| 14169 verify([source]); | 14436 verify([source]); |
| 14170 } | 14437 } |
| 14438 void test_nonAbstractClassInheritsAbstractMemberOne_setter_excluded() { |
| 14439 Source source = addSource(EngineTestCase.createSource([ |
| 14440 "class A {", |
| 14441 " final int x = 0;", |
| 14442 "}", |
| 14443 "class B implements A {", |
| 14444 " int get x => 42;", |
| 14445 "}"])); |
| 14446 resolve(source); |
| 14447 assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT
_MEMBER_ONE]); |
| 14448 verify([source]); |
| 14449 } |
| 14171 void test_nonAbstractClassInheritsAbstractMemberOne_setter_fromInterface() { | 14450 void test_nonAbstractClassInheritsAbstractMemberOne_setter_fromInterface() { |
| 14172 Source source = addSource(EngineTestCase.createSource([ | 14451 Source source = addSource(EngineTestCase.createSource([ |
| 14173 "class I {", | 14452 "class I {", |
| 14174 " set s(int i) {}", | 14453 " set s(int i) {}", |
| 14175 "}", | 14454 "}", |
| 14176 "class C implements I {", | 14455 "class C implements I {", |
| 14177 "}"])); | 14456 "}"])); |
| 14178 resolve(source); | 14457 resolve(source); |
| 14179 assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT
_MEMBER_ONE]); | 14458 assertErrors(source, [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT
_MEMBER_ONE]); |
| 14180 verify([source]); | 14459 verify([source]); |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14541 void test_undefinedIdentifier_metadata() { | 14820 void test_undefinedIdentifier_metadata() { |
| 14542 Source source = addSource(EngineTestCase.createSource(["@undefined class A {
}"])); | 14821 Source source = addSource(EngineTestCase.createSource(["@undefined class A {
}"])); |
| 14543 resolve(source); | 14822 resolve(source); |
| 14544 assertErrors(source, [StaticWarningCode.UNDEFINED_IDENTIFIER]); | 14823 assertErrors(source, [StaticWarningCode.UNDEFINED_IDENTIFIER]); |
| 14545 } | 14824 } |
| 14546 void test_undefinedIdentifier_methodInvocation() { | 14825 void test_undefinedIdentifier_methodInvocation() { |
| 14547 Source source = addSource(EngineTestCase.createSource(["f() { C.m(); }"])); | 14826 Source source = addSource(EngineTestCase.createSource(["f() { C.m(); }"])); |
| 14548 resolve(source); | 14827 resolve(source); |
| 14549 assertErrors(source, [StaticWarningCode.UNDEFINED_IDENTIFIER]); | 14828 assertErrors(source, [StaticWarningCode.UNDEFINED_IDENTIFIER]); |
| 14550 } | 14829 } |
| 14830 void test_undefinedIdentifier_private_getter() { |
| 14831 addSource2("/lib.dart", EngineTestCase.createSource(["library lib;", "class
A {", " var _foo;", "}"])); |
| 14832 Source source = addSource(EngineTestCase.createSource([ |
| 14833 "import 'lib.dart';", |
| 14834 "class B extends A {", |
| 14835 " test() {", |
| 14836 " var v = _foo;", |
| 14837 " }", |
| 14838 "}"])); |
| 14839 resolve(source); |
| 14840 assertErrors(source, [StaticWarningCode.UNDEFINED_IDENTIFIER]); |
| 14841 } |
| 14842 void test_undefinedIdentifier_private_setter() { |
| 14843 addSource2("/lib.dart", EngineTestCase.createSource(["library lib;", "class
A {", " var _foo;", "}"])); |
| 14844 Source source = addSource(EngineTestCase.createSource([ |
| 14845 "import 'lib.dart';", |
| 14846 "class B extends A {", |
| 14847 " test() {", |
| 14848 " _foo = 42;", |
| 14849 " }", |
| 14850 "}"])); |
| 14851 resolve(source); |
| 14852 assertErrors(source, [StaticWarningCode.UNDEFINED_IDENTIFIER]); |
| 14853 } |
| 14551 void test_undefinedNamedParameter() { | 14854 void test_undefinedNamedParameter() { |
| 14552 Source source = addSource(EngineTestCase.createSource(["f({a, b}) {}", "main
() {", " f(c: 1);", "}"])); | 14855 Source source = addSource(EngineTestCase.createSource(["f({a, b}) {}", "main
() {", " f(c: 1);", "}"])); |
| 14553 resolve(source); | 14856 resolve(source); |
| 14554 assertErrors(source, [StaticWarningCode.UNDEFINED_NAMED_PARAMETER]); | 14857 assertErrors(source, [StaticWarningCode.UNDEFINED_NAMED_PARAMETER]); |
| 14555 } | 14858 } |
| 14556 void test_undefinedSetter() { | 14859 void test_undefinedSetter() { |
| 14557 Source source1 = addSource2("lib.dart", ""); | 14860 Source source1 = addSource2("lib.dart", ""); |
| 14558 Source source2 = addSource2("lib2.dart", EngineTestCase.createSource([ | 14861 Source source2 = addSource2("lib2.dart", EngineTestCase.createSource([ |
| 14559 "import 'lib.dart' as lib;", | 14862 "import 'lib.dart' as lib;", |
| 14560 "void f() {", | 14863 "void f() {", |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14643 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_invocation_ca
llParameter); | 14946 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_invocation_ca
llParameter); |
| 14644 }); | 14947 }); |
| 14645 _ut.test('test_argumentTypeNotAssignable_invocation_callVariable', () { | 14948 _ut.test('test_argumentTypeNotAssignable_invocation_callVariable', () { |
| 14646 final __test = new StaticWarningCodeTest(); | 14949 final __test = new StaticWarningCodeTest(); |
| 14647 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_invocation_ca
llVariable); | 14950 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_invocation_ca
llVariable); |
| 14648 }); | 14951 }); |
| 14649 _ut.test('test_argumentTypeNotAssignable_invocation_functionParameter', ()
{ | 14952 _ut.test('test_argumentTypeNotAssignable_invocation_functionParameter', ()
{ |
| 14650 final __test = new StaticWarningCodeTest(); | 14953 final __test = new StaticWarningCodeTest(); |
| 14651 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_invocation_fu
nctionParameter); | 14954 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_invocation_fu
nctionParameter); |
| 14652 }); | 14955 }); |
| 14956 _ut.test('test_argumentTypeNotAssignable_invocation_functionParameter_gene
ric', () { |
| 14957 final __test = new StaticWarningCodeTest(); |
| 14958 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_invocation_fu
nctionParameter_generic); |
| 14959 }); |
| 14653 _ut.test('test_argumentTypeNotAssignable_invocation_functionTypes_optional
', () { | 14960 _ut.test('test_argumentTypeNotAssignable_invocation_functionTypes_optional
', () { |
| 14654 final __test = new StaticWarningCodeTest(); | 14961 final __test = new StaticWarningCodeTest(); |
| 14655 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_invocation_fu
nctionTypes_optional); | 14962 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_invocation_fu
nctionTypes_optional); |
| 14656 }); | 14963 }); |
| 14657 _ut.test('test_argumentTypeNotAssignable_invocation_generic', () { | 14964 _ut.test('test_argumentTypeNotAssignable_invocation_generic', () { |
| 14658 final __test = new StaticWarningCodeTest(); | 14965 final __test = new StaticWarningCodeTest(); |
| 14659 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_invocation_ge
neric); | 14966 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_invocation_ge
neric); |
| 14660 }); | 14967 }); |
| 14661 _ut.test('test_argumentTypeNotAssignable_invocation_named', () { | 14968 _ut.test('test_argumentTypeNotAssignable_invocation_named', () { |
| 14662 final __test = new StaticWarningCodeTest(); | 14969 final __test = new StaticWarningCodeTest(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14695 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_new_required)
; | 15002 runJUnitTest(__test, __test.test_argumentTypeNotAssignable_new_required)
; |
| 14696 }); | 15003 }); |
| 14697 _ut.test('test_assignmentToConst_instanceVariable', () { | 15004 _ut.test('test_assignmentToConst_instanceVariable', () { |
| 14698 final __test = new StaticWarningCodeTest(); | 15005 final __test = new StaticWarningCodeTest(); |
| 14699 runJUnitTest(__test, __test.test_assignmentToConst_instanceVariable); | 15006 runJUnitTest(__test, __test.test_assignmentToConst_instanceVariable); |
| 14700 }); | 15007 }); |
| 14701 _ut.test('test_assignmentToConst_localVariable', () { | 15008 _ut.test('test_assignmentToConst_localVariable', () { |
| 14702 final __test = new StaticWarningCodeTest(); | 15009 final __test = new StaticWarningCodeTest(); |
| 14703 runJUnitTest(__test, __test.test_assignmentToConst_localVariable); | 15010 runJUnitTest(__test, __test.test_assignmentToConst_localVariable); |
| 14704 }); | 15011 }); |
| 15012 _ut.test('test_assignmentToFinal_excludedSetter', () { |
| 15013 final __test = new StaticWarningCodeTest(); |
| 15014 runJUnitTest(__test, __test.test_assignmentToFinal_excludedSetter); |
| 15015 }); |
| 14705 _ut.test('test_assignmentToFinal_instanceVariable', () { | 15016 _ut.test('test_assignmentToFinal_instanceVariable', () { |
| 14706 final __test = new StaticWarningCodeTest(); | 15017 final __test = new StaticWarningCodeTest(); |
| 14707 runJUnitTest(__test, __test.test_assignmentToFinal_instanceVariable); | 15018 runJUnitTest(__test, __test.test_assignmentToFinal_instanceVariable); |
| 14708 }); | 15019 }); |
| 14709 _ut.test('test_assignmentToFinal_localVariable', () { | 15020 _ut.test('test_assignmentToFinal_localVariable', () { |
| 14710 final __test = new StaticWarningCodeTest(); | 15021 final __test = new StaticWarningCodeTest(); |
| 14711 runJUnitTest(__test, __test.test_assignmentToFinal_localVariable); | 15022 runJUnitTest(__test, __test.test_assignmentToFinal_localVariable); |
| 14712 }); | 15023 }); |
| 14713 _ut.test('test_assignmentToFinal_prefixMinusMinus', () { | 15024 _ut.test('test_assignmentToFinal_prefixMinusMinus', () { |
| 14714 final __test = new StaticWarningCodeTest(); | 15025 final __test = new StaticWarningCodeTest(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 14743 runJUnitTest(__test, __test.test_caseBlockNotTerminated); | 15054 runJUnitTest(__test, __test.test_caseBlockNotTerminated); |
| 14744 }); | 15055 }); |
| 14745 _ut.test('test_castToNonType', () { | 15056 _ut.test('test_castToNonType', () { |
| 14746 final __test = new StaticWarningCodeTest(); | 15057 final __test = new StaticWarningCodeTest(); |
| 14747 runJUnitTest(__test, __test.test_castToNonType); | 15058 runJUnitTest(__test, __test.test_castToNonType); |
| 14748 }); | 15059 }); |
| 14749 _ut.test('test_concreteClassWithAbstractMember', () { | 15060 _ut.test('test_concreteClassWithAbstractMember', () { |
| 14750 final __test = new StaticWarningCodeTest(); | 15061 final __test = new StaticWarningCodeTest(); |
| 14751 runJUnitTest(__test, __test.test_concreteClassWithAbstractMember); | 15062 runJUnitTest(__test, __test.test_concreteClassWithAbstractMember); |
| 14752 }); | 15063 }); |
| 15064 _ut.test('test_conflictingDartImport', () { |
| 15065 final __test = new StaticWarningCodeTest(); |
| 15066 runJUnitTest(__test, __test.test_conflictingDartImport); |
| 15067 }); |
| 14753 _ut.test('test_conflictingInstanceGetterAndSuperclassMember_direct_field',
() { | 15068 _ut.test('test_conflictingInstanceGetterAndSuperclassMember_direct_field',
() { |
| 14754 final __test = new StaticWarningCodeTest(); | 15069 final __test = new StaticWarningCodeTest(); |
| 14755 runJUnitTest(__test, __test.test_conflictingInstanceGetterAndSuperclassM
ember_direct_field); | 15070 runJUnitTest(__test, __test.test_conflictingInstanceGetterAndSuperclassM
ember_direct_field); |
| 14756 }); | 15071 }); |
| 14757 _ut.test('test_conflictingInstanceGetterAndSuperclassMember_direct_getter'
, () { | 15072 _ut.test('test_conflictingInstanceGetterAndSuperclassMember_direct_getter'
, () { |
| 14758 final __test = new StaticWarningCodeTest(); | 15073 final __test = new StaticWarningCodeTest(); |
| 14759 runJUnitTest(__test, __test.test_conflictingInstanceGetterAndSuperclassM
ember_direct_getter); | 15074 runJUnitTest(__test, __test.test_conflictingInstanceGetterAndSuperclassM
ember_direct_getter); |
| 14760 }); | 15075 }); |
| 14761 _ut.test('test_conflictingInstanceGetterAndSuperclassMember_direct_method'
, () { | 15076 _ut.test('test_conflictingInstanceGetterAndSuperclassMember_direct_method'
, () { |
| 14762 final __test = new StaticWarningCodeTest(); | 15077 final __test = new StaticWarningCodeTest(); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14947 runJUnitTest(__test, __test.test_invalidOverrideDifferentDefaultValues_p
ositional); | 15262 runJUnitTest(__test, __test.test_invalidOverrideDifferentDefaultValues_p
ositional); |
| 14948 }); | 15263 }); |
| 14949 _ut.test('test_invalidOverrideNamed_fewerNamedParameters', () { | 15264 _ut.test('test_invalidOverrideNamed_fewerNamedParameters', () { |
| 14950 final __test = new StaticWarningCodeTest(); | 15265 final __test = new StaticWarningCodeTest(); |
| 14951 runJUnitTest(__test, __test.test_invalidOverrideNamed_fewerNamedParamete
rs); | 15266 runJUnitTest(__test, __test.test_invalidOverrideNamed_fewerNamedParamete
rs); |
| 14952 }); | 15267 }); |
| 14953 _ut.test('test_invalidOverrideNamed_missingNamedParameter', () { | 15268 _ut.test('test_invalidOverrideNamed_missingNamedParameter', () { |
| 14954 final __test = new StaticWarningCodeTest(); | 15269 final __test = new StaticWarningCodeTest(); |
| 14955 runJUnitTest(__test, __test.test_invalidOverrideNamed_missingNamedParame
ter); | 15270 runJUnitTest(__test, __test.test_invalidOverrideNamed_missingNamedParame
ter); |
| 14956 }); | 15271 }); |
| 14957 _ut.test('test_invalidOverridePositional', () { | 15272 _ut.test('test_invalidOverridePositional_optional', () { |
| 14958 final __test = new StaticWarningCodeTest(); | 15273 final __test = new StaticWarningCodeTest(); |
| 14959 runJUnitTest(__test, __test.test_invalidOverridePositional); | 15274 runJUnitTest(__test, __test.test_invalidOverridePositional_optional); |
| 15275 }); |
| 15276 _ut.test('test_invalidOverridePositional_optionalAndRequired', () { |
| 15277 final __test = new StaticWarningCodeTest(); |
| 15278 runJUnitTest(__test, __test.test_invalidOverridePositional_optionalAndRe
quired); |
| 15279 }); |
| 15280 _ut.test('test_invalidOverridePositional_optionalAndRequired2', () { |
| 15281 final __test = new StaticWarningCodeTest(); |
| 15282 runJUnitTest(__test, __test.test_invalidOverridePositional_optionalAndRe
quired2); |
| 14960 }); | 15283 }); |
| 14961 _ut.test('test_invalidOverrideRequired', () { | 15284 _ut.test('test_invalidOverrideRequired', () { |
| 14962 final __test = new StaticWarningCodeTest(); | 15285 final __test = new StaticWarningCodeTest(); |
| 14963 runJUnitTest(__test, __test.test_invalidOverrideRequired); | 15286 runJUnitTest(__test, __test.test_invalidOverrideRequired); |
| 14964 }); | 15287 }); |
| 14965 _ut.test('test_invalidSetterOverrideNormalParamType', () { | 15288 _ut.test('test_invalidSetterOverrideNormalParamType', () { |
| 14966 final __test = new StaticWarningCodeTest(); | 15289 final __test = new StaticWarningCodeTest(); |
| 14967 runJUnitTest(__test, __test.test_invalidSetterOverrideNormalParamType); | 15290 runJUnitTest(__test, __test.test_invalidSetterOverrideNormalParamType); |
| 14968 }); | 15291 }); |
| 14969 _ut.test('test_listElementTypeNotAssignable', () { | 15292 _ut.test('test_listElementTypeNotAssignable', () { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15039 runJUnitTest(__test, __test.test_nonAbstractClassInheritsAbstractMemberO
ne_method_fromInterface); | 15362 runJUnitTest(__test, __test.test_nonAbstractClassInheritsAbstractMemberO
ne_method_fromInterface); |
| 15040 }); | 15363 }); |
| 15041 _ut.test('test_nonAbstractClassInheritsAbstractMemberOne_method_fromSuperc
lass', () { | 15364 _ut.test('test_nonAbstractClassInheritsAbstractMemberOne_method_fromSuperc
lass', () { |
| 15042 final __test = new StaticWarningCodeTest(); | 15365 final __test = new StaticWarningCodeTest(); |
| 15043 runJUnitTest(__test, __test.test_nonAbstractClassInheritsAbstractMemberO
ne_method_fromSuperclass); | 15366 runJUnitTest(__test, __test.test_nonAbstractClassInheritsAbstractMemberO
ne_method_fromSuperclass); |
| 15044 }); | 15367 }); |
| 15045 _ut.test('test_nonAbstractClassInheritsAbstractMemberOne_method_optionalPa
ramCount', () { | 15368 _ut.test('test_nonAbstractClassInheritsAbstractMemberOne_method_optionalPa
ramCount', () { |
| 15046 final __test = new StaticWarningCodeTest(); | 15369 final __test = new StaticWarningCodeTest(); |
| 15047 runJUnitTest(__test, __test.test_nonAbstractClassInheritsAbstractMemberO
ne_method_optionalParamCount); | 15370 runJUnitTest(__test, __test.test_nonAbstractClassInheritsAbstractMemberO
ne_method_optionalParamCount); |
| 15048 }); | 15371 }); |
| 15372 _ut.test('test_nonAbstractClassInheritsAbstractMemberOne_setter_excluded',
() { |
| 15373 final __test = new StaticWarningCodeTest(); |
| 15374 runJUnitTest(__test, __test.test_nonAbstractClassInheritsAbstractMemberO
ne_setter_excluded); |
| 15375 }); |
| 15049 _ut.test('test_nonAbstractClassInheritsAbstractMemberOne_setter_fromInterf
ace', () { | 15376 _ut.test('test_nonAbstractClassInheritsAbstractMemberOne_setter_fromInterf
ace', () { |
| 15050 final __test = new StaticWarningCodeTest(); | 15377 final __test = new StaticWarningCodeTest(); |
| 15051 runJUnitTest(__test, __test.test_nonAbstractClassInheritsAbstractMemberO
ne_setter_fromInterface); | 15378 runJUnitTest(__test, __test.test_nonAbstractClassInheritsAbstractMemberO
ne_setter_fromInterface); |
| 15052 }); | 15379 }); |
| 15053 _ut.test('test_nonAbstractClassInheritsAbstractMemberOne_setter_fromSuperc
lass', () { | 15380 _ut.test('test_nonAbstractClassInheritsAbstractMemberOne_setter_fromSuperc
lass', () { |
| 15054 final __test = new StaticWarningCodeTest(); | 15381 final __test = new StaticWarningCodeTest(); |
| 15055 runJUnitTest(__test, __test.test_nonAbstractClassInheritsAbstractMemberO
ne_setter_fromSuperclass); | 15382 runJUnitTest(__test, __test.test_nonAbstractClassInheritsAbstractMemberO
ne_setter_fromSuperclass); |
| 15056 }); | 15383 }); |
| 15057 _ut.test('test_nonAbstractClassInheritsAbstractMemberOne_superclasses_inte
rface', () { | 15384 _ut.test('test_nonAbstractClassInheritsAbstractMemberOne_superclasses_inte
rface', () { |
| 15058 final __test = new StaticWarningCodeTest(); | 15385 final __test = new StaticWarningCodeTest(); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15227 runJUnitTest(__test, __test.test_undefinedIdentifier_initializer_prefix)
; | 15554 runJUnitTest(__test, __test.test_undefinedIdentifier_initializer_prefix)
; |
| 15228 }); | 15555 }); |
| 15229 _ut.test('test_undefinedIdentifier_metadata', () { | 15556 _ut.test('test_undefinedIdentifier_metadata', () { |
| 15230 final __test = new StaticWarningCodeTest(); | 15557 final __test = new StaticWarningCodeTest(); |
| 15231 runJUnitTest(__test, __test.test_undefinedIdentifier_metadata); | 15558 runJUnitTest(__test, __test.test_undefinedIdentifier_metadata); |
| 15232 }); | 15559 }); |
| 15233 _ut.test('test_undefinedIdentifier_methodInvocation', () { | 15560 _ut.test('test_undefinedIdentifier_methodInvocation', () { |
| 15234 final __test = new StaticWarningCodeTest(); | 15561 final __test = new StaticWarningCodeTest(); |
| 15235 runJUnitTest(__test, __test.test_undefinedIdentifier_methodInvocation); | 15562 runJUnitTest(__test, __test.test_undefinedIdentifier_methodInvocation); |
| 15236 }); | 15563 }); |
| 15564 _ut.test('test_undefinedIdentifier_private_getter', () { |
| 15565 final __test = new StaticWarningCodeTest(); |
| 15566 runJUnitTest(__test, __test.test_undefinedIdentifier_private_getter); |
| 15567 }); |
| 15568 _ut.test('test_undefinedIdentifier_private_setter', () { |
| 15569 final __test = new StaticWarningCodeTest(); |
| 15570 runJUnitTest(__test, __test.test_undefinedIdentifier_private_setter); |
| 15571 }); |
| 15237 _ut.test('test_undefinedNamedParameter', () { | 15572 _ut.test('test_undefinedNamedParameter', () { |
| 15238 final __test = new StaticWarningCodeTest(); | 15573 final __test = new StaticWarningCodeTest(); |
| 15239 runJUnitTest(__test, __test.test_undefinedNamedParameter); | 15574 runJUnitTest(__test, __test.test_undefinedNamedParameter); |
| 15240 }); | 15575 }); |
| 15241 _ut.test('test_undefinedSetter', () { | 15576 _ut.test('test_undefinedSetter', () { |
| 15242 final __test = new StaticWarningCodeTest(); | 15577 final __test = new StaticWarningCodeTest(); |
| 15243 runJUnitTest(__test, __test.test_undefinedSetter); | 15578 runJUnitTest(__test, __test.test_undefinedSetter); |
| 15244 }); | 15579 }); |
| 15245 }); | 15580 }); |
| 15246 } | 15581 } |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15787 ClassElement type = ElementFactory.classElement2(typeName, []); | 16122 ClassElement type = ElementFactory.classElement2(typeName, []); |
| 15788 LibraryElement importedLibrary = createTestLibrary2(context, "lib", []); | 16123 LibraryElement importedLibrary = createTestLibrary2(context, "lib", []); |
| 15789 ((importedLibrary.definingCompilationUnit as CompilationUnitElementImpl)).ty
pes = <ClassElement> [type]; | 16124 ((importedLibrary.definingCompilationUnit as CompilationUnitElementImpl)).ty
pes = <ClassElement> [type]; |
| 15790 ImportElementImpl importCore = ElementFactory.importFor(context.getLibraryEl
ement(context.sourceFactory.forUri("dart:core")), null, []); | 16125 ImportElementImpl importCore = ElementFactory.importFor(context.getLibraryEl
ement(context.sourceFactory.forUri("dart:core")), null, []); |
| 15791 ImportElementImpl importLib = ElementFactory.importFor(importedLibrary, null
, []); | 16126 ImportElementImpl importLib = ElementFactory.importFor(importedLibrary, null
, []); |
| 15792 LibraryElementImpl importingLibrary = createTestLibrary2(context, "importing
", []); | 16127 LibraryElementImpl importingLibrary = createTestLibrary2(context, "importing
", []); |
| 15793 importingLibrary.imports = <ImportElement> [importCore, importLib]; | 16128 importingLibrary.imports = <ImportElement> [importCore, importLib]; |
| 15794 GatheringErrorListener errorListener = new GatheringErrorListener(); | 16129 GatheringErrorListener errorListener = new GatheringErrorListener(); |
| 15795 Scope scope = new LibraryImportScope(importingLibrary, errorListener); | 16130 Scope scope = new LibraryImportScope(importingLibrary, errorListener); |
| 15796 JUnitTestCase.assertEquals(type, scope.lookup(ASTFactory.identifier3(typeNam
e), importingLibrary)); | 16131 JUnitTestCase.assertEquals(type, scope.lookup(ASTFactory.identifier3(typeNam
e), importingLibrary)); |
| 15797 errorListener.assertNoErrors(); | 16132 errorListener.assertErrors2([StaticWarningCode.CONFLICTING_DART_IMPORT]); |
| 15798 } | 16133 } |
| 15799 void test_nonConflictingImports_sameElement() { | 16134 void test_nonConflictingImports_sameElement() { |
| 15800 AnalysisContext context = new AnalysisContextImpl(); | 16135 AnalysisContext context = new AnalysisContextImpl(); |
| 15801 String typeNameA = "A"; | 16136 String typeNameA = "A"; |
| 15802 String typeNameB = "B"; | 16137 String typeNameB = "B"; |
| 15803 ClassElement typeA = ElementFactory.classElement2(typeNameA, []); | 16138 ClassElement typeA = ElementFactory.classElement2(typeNameA, []); |
| 15804 ClassElement typeB = ElementFactory.classElement2(typeNameB, []); | 16139 ClassElement typeB = ElementFactory.classElement2(typeNameB, []); |
| 15805 LibraryElement importedLibrary = createTestLibrary2(context, "imported", [])
; | 16140 LibraryElement importedLibrary = createTestLibrary2(context, "imported", [])
; |
| 15806 ((importedLibrary.definingCompilationUnit as CompilationUnitElementImpl)).ty
pes = <ClassElement> [typeA, typeB]; | 16141 ((importedLibrary.definingCompilationUnit as CompilationUnitElementImpl)).ty
pes = <ClassElement> [typeA, typeB]; |
| 15807 ImportElementImpl import1 = ElementFactory.importFor(importedLibrary, null,
[]); | 16142 ImportElementImpl import1 = ElementFactory.importFor(importedLibrary, null,
[]); |
| (...skipping 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17466 "class B<E> {", | 17801 "class B<E> {", |
| 17467 " E e;", | 17802 " E e;", |
| 17468 " m() {", | 17803 " m() {", |
| 17469 " (e as A).a();", | 17804 " (e as A).a();", |
| 17470 " }", | 17805 " }", |
| 17471 "}"])); | 17806 "}"])); |
| 17472 resolve(source); | 17807 resolve(source); |
| 17473 assertNoErrors(source); | 17808 assertNoErrors(source); |
| 17474 verify([source]); | 17809 verify([source]); |
| 17475 } | 17810 } |
| 17811 void test_undefinedGetter_inSubtype() { |
| 17812 Source source = addSource(EngineTestCase.createSource([ |
| 17813 "class A {}", |
| 17814 "class B extends A {", |
| 17815 " get b => 0;", |
| 17816 "}", |
| 17817 "f(var a) {", |
| 17818 " if(a is A) {", |
| 17819 " return a.b;", |
| 17820 " }", |
| 17821 "}"])); |
| 17822 resolve(source); |
| 17823 assertNoErrors(source); |
| 17824 } |
| 17825 void test_undefinedMethod_assignmentExpression_inSubtype() { |
| 17826 Source source = addSource(EngineTestCase.createSource([ |
| 17827 "class A {}", |
| 17828 "class B extends A {", |
| 17829 " operator +(B b) {return new B();}", |
| 17830 "}", |
| 17831 "f(var a, var a2) {", |
| 17832 " a = new A();", |
| 17833 " a2 = new A();", |
| 17834 " a += a2;", |
| 17835 "}"])); |
| 17836 resolve(source); |
| 17837 assertNoErrors(source); |
| 17838 } |
| 17839 void test_undefinedMethod_inSubtype() { |
| 17840 Source source = addSource(EngineTestCase.createSource([ |
| 17841 "class A {}", |
| 17842 "class B extends A {", |
| 17843 " b() {}", |
| 17844 "}", |
| 17845 "f() {", |
| 17846 " var a = new A();", |
| 17847 " a.b();", |
| 17848 "}"])); |
| 17849 resolve(source); |
| 17850 assertNoErrors(source); |
| 17851 } |
| 17852 void test_undefinedOperator_binaryExpression_inSubtype() { |
| 17853 Source source = addSource(EngineTestCase.createSource([ |
| 17854 "class A {}", |
| 17855 "class B extends A {", |
| 17856 " operator +(B b) {}", |
| 17857 "}", |
| 17858 "f(var a) {", |
| 17859 " if(a is A) {", |
| 17860 " a + 1;", |
| 17861 " }", |
| 17862 "}"])); |
| 17863 resolve(source); |
| 17864 assertNoErrors(source); |
| 17865 } |
| 17866 void test_undefinedOperator_indexBoth_inSubtype() { |
| 17867 Source source = addSource(EngineTestCase.createSource([ |
| 17868 "class A {}", |
| 17869 "class B extends A {", |
| 17870 " operator [](int index) {}", |
| 17871 "}", |
| 17872 "f(var a) {", |
| 17873 " if(a is A) {", |
| 17874 " a[0]++;", |
| 17875 " }", |
| 17876 "}"])); |
| 17877 resolve(source); |
| 17878 assertNoErrors(source); |
| 17879 } |
| 17880 void test_undefinedOperator_indexGetter_inSubtype() { |
| 17881 Source source = addSource(EngineTestCase.createSource([ |
| 17882 "class A {}", |
| 17883 "class B extends A {", |
| 17884 " operator [](int index) {}", |
| 17885 "}", |
| 17886 "f(var a) {", |
| 17887 " if(a is A) {", |
| 17888 " a[0];", |
| 17889 " }", |
| 17890 "}"])); |
| 17891 resolve(source); |
| 17892 assertNoErrors(source); |
| 17893 } |
| 17894 void test_undefinedOperator_indexSetter_inSubtype() { |
| 17895 Source source = addSource(EngineTestCase.createSource([ |
| 17896 "class A {}", |
| 17897 "class B extends A {", |
| 17898 " operator []=(i, v) {}", |
| 17899 "}", |
| 17900 "f(var a) {", |
| 17901 " if(a is A) {", |
| 17902 " a[0] = 1;", |
| 17903 " }", |
| 17904 "}"])); |
| 17905 resolve(source); |
| 17906 assertNoErrors(source); |
| 17907 } |
| 17908 void test_undefinedOperator_postfixExpression() { |
| 17909 Source source = addSource(EngineTestCase.createSource([ |
| 17910 "class A {}", |
| 17911 "class B extends A {", |
| 17912 " operator +(B b) {return new B();}", |
| 17913 "}", |
| 17914 "f(var a) {", |
| 17915 " if(a is A) {", |
| 17916 " a++;", |
| 17917 " }", |
| 17918 "}"])); |
| 17919 resolve(source); |
| 17920 assertNoErrors(source); |
| 17921 } |
| 17922 void test_undefinedOperator_prefixExpression() { |
| 17923 Source source = addSource(EngineTestCase.createSource([ |
| 17924 "class A {}", |
| 17925 "class B extends A {", |
| 17926 " operator +(B b) {return new B();}", |
| 17927 "}", |
| 17928 "f(var a) {", |
| 17929 " if(a is A) {", |
| 17930 " ++a;", |
| 17931 " }", |
| 17932 "}"])); |
| 17933 resolve(source); |
| 17934 assertNoErrors(source); |
| 17935 } |
| 17936 void test_undefinedSetter_inSubtype() { |
| 17937 Source source = addSource(EngineTestCase.createSource([ |
| 17938 "class A {}", |
| 17939 "class B extends A {", |
| 17940 " set b(x) {}", |
| 17941 "}", |
| 17942 "f(var a) {", |
| 17943 " if(a is A) {", |
| 17944 " a.b = 0;", |
| 17945 " }", |
| 17946 "}"])); |
| 17947 resolve(source); |
| 17948 assertNoErrors(source); |
| 17949 } |
| 17476 void test_unnecessaryCast_dynamic_type() { | 17950 void test_unnecessaryCast_dynamic_type() { |
| 17477 Source source = addSource(EngineTestCase.createSource(["m(v) {", " var b =
v as Object;", "}"])); | 17951 Source source = addSource(EngineTestCase.createSource(["m(v) {", " var b =
v as Object;", "}"])); |
| 17478 resolve(source); | 17952 resolve(source); |
| 17479 assertNoErrors(source); | 17953 assertNoErrors(source); |
| 17480 verify([source]); | 17954 verify([source]); |
| 17481 } | 17955 } |
| 17482 void test_unnecessaryCast_type_dynamic() { | 17956 void test_unnecessaryCast_type_dynamic() { |
| 17483 Source source = addSource(EngineTestCase.createSource(["m(v) {", " var b =
Object as dynamic;", "}"])); | 17957 Source source = addSource(EngineTestCase.createSource(["m(v) {", " var b =
Object as dynamic;", "}"])); |
| 17484 resolve(source); | 17958 resolve(source); |
| 17485 assertNoErrors(source); | 17959 assertNoErrors(source); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17611 runJUnitTest(__test, __test.test_duplicateImport_show); | 18085 runJUnitTest(__test, __test.test_duplicateImport_show); |
| 17612 }); | 18086 }); |
| 17613 _ut.test('test_overriddingPrivateMember_sameLibrary', () { | 18087 _ut.test('test_overriddingPrivateMember_sameLibrary', () { |
| 17614 final __test = new NonHintCodeTest(); | 18088 final __test = new NonHintCodeTest(); |
| 17615 runJUnitTest(__test, __test.test_overriddingPrivateMember_sameLibrary); | 18089 runJUnitTest(__test, __test.test_overriddingPrivateMember_sameLibrary); |
| 17616 }); | 18090 }); |
| 17617 _ut.test('test_overrideEqualsButNotHashCode', () { | 18091 _ut.test('test_overrideEqualsButNotHashCode', () { |
| 17618 final __test = new NonHintCodeTest(); | 18092 final __test = new NonHintCodeTest(); |
| 17619 runJUnitTest(__test, __test.test_overrideEqualsButNotHashCode); | 18093 runJUnitTest(__test, __test.test_overrideEqualsButNotHashCode); |
| 17620 }); | 18094 }); |
| 18095 _ut.test('test_undefinedGetter_inSubtype', () { |
| 18096 final __test = new NonHintCodeTest(); |
| 18097 runJUnitTest(__test, __test.test_undefinedGetter_inSubtype); |
| 18098 }); |
| 18099 _ut.test('test_undefinedMethod_assignmentExpression_inSubtype', () { |
| 18100 final __test = new NonHintCodeTest(); |
| 18101 runJUnitTest(__test, __test.test_undefinedMethod_assignmentExpression_in
Subtype); |
| 18102 }); |
| 18103 _ut.test('test_undefinedMethod_inSubtype', () { |
| 18104 final __test = new NonHintCodeTest(); |
| 18105 runJUnitTest(__test, __test.test_undefinedMethod_inSubtype); |
| 18106 }); |
| 18107 _ut.test('test_undefinedOperator_binaryExpression_inSubtype', () { |
| 18108 final __test = new NonHintCodeTest(); |
| 18109 runJUnitTest(__test, __test.test_undefinedOperator_binaryExpression_inSu
btype); |
| 18110 }); |
| 18111 _ut.test('test_undefinedOperator_indexBoth_inSubtype', () { |
| 18112 final __test = new NonHintCodeTest(); |
| 18113 runJUnitTest(__test, __test.test_undefinedOperator_indexBoth_inSubtype); |
| 18114 }); |
| 18115 _ut.test('test_undefinedOperator_indexGetter_inSubtype', () { |
| 18116 final __test = new NonHintCodeTest(); |
| 18117 runJUnitTest(__test, __test.test_undefinedOperator_indexGetter_inSubtype
); |
| 18118 }); |
| 18119 _ut.test('test_undefinedOperator_indexSetter_inSubtype', () { |
| 18120 final __test = new NonHintCodeTest(); |
| 18121 runJUnitTest(__test, __test.test_undefinedOperator_indexSetter_inSubtype
); |
| 18122 }); |
| 18123 _ut.test('test_undefinedOperator_postfixExpression', () { |
| 18124 final __test = new NonHintCodeTest(); |
| 18125 runJUnitTest(__test, __test.test_undefinedOperator_postfixExpression); |
| 18126 }); |
| 18127 _ut.test('test_undefinedOperator_prefixExpression', () { |
| 18128 final __test = new NonHintCodeTest(); |
| 18129 runJUnitTest(__test, __test.test_undefinedOperator_prefixExpression); |
| 18130 }); |
| 18131 _ut.test('test_undefinedSetter_inSubtype', () { |
| 18132 final __test = new NonHintCodeTest(); |
| 18133 runJUnitTest(__test, __test.test_undefinedSetter_inSubtype); |
| 18134 }); |
| 17621 _ut.test('test_unnecessaryCast_13855_parameter_A', () { | 18135 _ut.test('test_unnecessaryCast_13855_parameter_A', () { |
| 17622 final __test = new NonHintCodeTest(); | 18136 final __test = new NonHintCodeTest(); |
| 17623 runJUnitTest(__test, __test.test_unnecessaryCast_13855_parameter_A); | 18137 runJUnitTest(__test, __test.test_unnecessaryCast_13855_parameter_A); |
| 17624 }); | 18138 }); |
| 17625 _ut.test('test_unnecessaryCast_dynamic_type', () { | 18139 _ut.test('test_unnecessaryCast_dynamic_type', () { |
| 17626 final __test = new NonHintCodeTest(); | 18140 final __test = new NonHintCodeTest(); |
| 17627 runJUnitTest(__test, __test.test_unnecessaryCast_dynamic_type); | 18141 runJUnitTest(__test, __test.test_unnecessaryCast_dynamic_type); |
| 17628 }); | 18142 }); |
| 17629 _ut.test('test_unnecessaryCast_type_dynamic', () { | 18143 _ut.test('test_unnecessaryCast_type_dynamic', () { |
| 17630 final __test = new NonHintCodeTest(); | 18144 final __test = new NonHintCodeTest(); |
| (...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18758 final __test = new SimpleResolverTest(); | 19272 final __test = new SimpleResolverTest(); |
| 18759 runJUnitTest(__test, __test.test_setter_inherited); | 19273 runJUnitTest(__test, __test.test_setter_inherited); |
| 18760 }); | 19274 }); |
| 18761 _ut.test('test_setter_static', () { | 19275 _ut.test('test_setter_static', () { |
| 18762 final __test = new SimpleResolverTest(); | 19276 final __test = new SimpleResolverTest(); |
| 18763 runJUnitTest(__test, __test.test_setter_static); | 19277 runJUnitTest(__test, __test.test_setter_static); |
| 18764 }); | 19278 }); |
| 18765 }); | 19279 }); |
| 18766 } | 19280 } |
| 18767 } | 19281 } |
| 19282 class SubtypeManagerTest extends EngineTestCase { |
| 19283 |
| 19284 /** |
| 19285 * The inheritance manager being tested. |
| 19286 */ |
| 19287 SubtypeManager _subtypeManager; |
| 19288 |
| 19289 /** |
| 19290 * The compilation unit element containing all of the types setup in each test
. |
| 19291 */ |
| 19292 CompilationUnitElementImpl _definingCompilationUnit; |
| 19293 void test_computeAllSubtypes_infiniteLoop() { |
| 19294 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 19295 ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []); |
| 19296 classA.supertype = classB.type; |
| 19297 _definingCompilationUnit.types = <ClassElement> [classA, classB]; |
| 19298 Set<ClassElement> subtypesOfA = _subtypeManager.computeAllSubtypes(classA); |
| 19299 List<ClassElement> arraySubtypesOfA = new List.from(subtypesOfA); |
| 19300 EngineTestCase.assertSize3(2, subtypesOfA); |
| 19301 EngineTestCase.assertContains(arraySubtypesOfA, [classA, classB]); |
| 19302 } |
| 19303 void test_computeAllSubtypes_manyRecursiveSubtypes() { |
| 19304 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 19305 ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []); |
| 19306 ClassElementImpl classC = ElementFactory.classElement("C", classB.type, []); |
| 19307 ClassElementImpl classD = ElementFactory.classElement("D", classB.type, []); |
| 19308 ClassElementImpl classE = ElementFactory.classElement("E", classB.type, []); |
| 19309 _definingCompilationUnit.types = <ClassElement> [classA, classB, classC, cla
ssD, classE]; |
| 19310 Set<ClassElement> subtypesOfA = _subtypeManager.computeAllSubtypes(classA); |
| 19311 List<ClassElement> arraySubtypesOfA = new List.from(subtypesOfA); |
| 19312 Set<ClassElement> subtypesOfB = _subtypeManager.computeAllSubtypes(classB); |
| 19313 List<ClassElement> arraySubtypesOfB = new List.from(subtypesOfB); |
| 19314 EngineTestCase.assertSize3(4, subtypesOfA); |
| 19315 EngineTestCase.assertContains(arraySubtypesOfA, [classB, classC, classD, cla
ssE]); |
| 19316 EngineTestCase.assertSize3(3, subtypesOfB); |
| 19317 EngineTestCase.assertContains(arraySubtypesOfB, [classC, classD, classE]); |
| 19318 } |
| 19319 void test_computeAllSubtypes_noSubtypes() { |
| 19320 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 19321 _definingCompilationUnit.types = <ClassElement> [classA]; |
| 19322 Set<ClassElement> subtypesOfA = _subtypeManager.computeAllSubtypes(classA); |
| 19323 EngineTestCase.assertSize3(0, subtypesOfA); |
| 19324 } |
| 19325 void test_computeAllSubtypes_oneSubtype() { |
| 19326 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 19327 ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []); |
| 19328 _definingCompilationUnit.types = <ClassElement> [classA, classB]; |
| 19329 Set<ClassElement> subtypesOfA = _subtypeManager.computeAllSubtypes(classA); |
| 19330 List<ClassElement> arraySubtypesOfA = new List.from(subtypesOfA); |
| 19331 EngineTestCase.assertSize3(1, subtypesOfA); |
| 19332 EngineTestCase.assertContains(arraySubtypesOfA, [classB]); |
| 19333 } |
| 19334 void setUp() { |
| 19335 super.setUp(); |
| 19336 AnalysisContextImpl context = AnalysisContextFactory.contextWithCore(); |
| 19337 FileBasedSource source = new FileBasedSource.con1(new ContentCache(), FileUt
ilities2.createFile("/test.dart")); |
| 19338 _definingCompilationUnit = new CompilationUnitElementImpl("test.dart"); |
| 19339 _definingCompilationUnit.source = source; |
| 19340 LibraryElementImpl definingLibrary = ElementFactory.library(context, "test")
; |
| 19341 definingLibrary.definingCompilationUnit = _definingCompilationUnit; |
| 19342 _subtypeManager = new SubtypeManager(); |
| 19343 } |
| 19344 static dartSuite() { |
| 19345 _ut.group('SubtypeManagerTest', () { |
| 19346 _ut.test('test_computeAllSubtypes_infiniteLoop', () { |
| 19347 final __test = new SubtypeManagerTest(); |
| 19348 runJUnitTest(__test, __test.test_computeAllSubtypes_infiniteLoop); |
| 19349 }); |
| 19350 _ut.test('test_computeAllSubtypes_manyRecursiveSubtypes', () { |
| 19351 final __test = new SubtypeManagerTest(); |
| 19352 runJUnitTest(__test, __test.test_computeAllSubtypes_manyRecursiveSubtype
s); |
| 19353 }); |
| 19354 _ut.test('test_computeAllSubtypes_noSubtypes', () { |
| 19355 final __test = new SubtypeManagerTest(); |
| 19356 runJUnitTest(__test, __test.test_computeAllSubtypes_noSubtypes); |
| 19357 }); |
| 19358 _ut.test('test_computeAllSubtypes_oneSubtype', () { |
| 19359 final __test = new SubtypeManagerTest(); |
| 19360 runJUnitTest(__test, __test.test_computeAllSubtypes_oneSubtype); |
| 19361 }); |
| 19362 }); |
| 19363 } |
| 19364 } |
| 18768 main() { | 19365 main() { |
| 18769 // ElementResolverTest.dartSuite(); | 19366 // ElementResolverTest.dartSuite(); |
| 18770 // InheritanceManagerTest.dartSuite(); | 19367 // InheritanceManagerTest.dartSuite(); |
| 18771 // LibraryElementBuilderTest.dartSuite(); | 19368 // LibraryElementBuilderTest.dartSuite(); |
| 18772 // LibraryTest.dartSuite(); | 19369 // LibraryTest.dartSuite(); |
| 18773 // StaticTypeAnalyzerTest.dartSuite(); | 19370 // StaticTypeAnalyzerTest.dartSuite(); |
| 19371 // SubtypeManagerTest.dartSuite(); |
| 18774 // TypeOverrideManagerTest.dartSuite(); | 19372 // TypeOverrideManagerTest.dartSuite(); |
| 18775 // TypeProviderImplTest.dartSuite(); | 19373 // TypeProviderImplTest.dartSuite(); |
| 18776 // TypeResolverVisitorTest.dartSuite(); | 19374 // TypeResolverVisitorTest.dartSuite(); |
| 18777 // EnclosedScopeTest.dartSuite(); | 19375 // EnclosedScopeTest.dartSuite(); |
| 18778 // LibraryImportScopeTest.dartSuite(); | 19376 // LibraryImportScopeTest.dartSuite(); |
| 18779 // LibraryScopeTest.dartSuite(); | 19377 // LibraryScopeTest.dartSuite(); |
| 18780 // ScopeTest.dartSuite(); | 19378 // ScopeTest.dartSuite(); |
| 18781 // CompileTimeErrorCodeTest.dartSuite(); | 19379 // CompileTimeErrorCodeTest.dartSuite(); |
| 18782 // ErrorResolverTest.dartSuite(); | 19380 // ErrorResolverTest.dartSuite(); |
| 18783 // HintCodeTest.dartSuite(); | 19381 // HintCodeTest.dartSuite(); |
| 18784 // MemberMapTest.dartSuite(); | 19382 // MemberMapTest.dartSuite(); |
| 18785 // NonHintCodeTest.dartSuite(); | 19383 // NonHintCodeTest.dartSuite(); |
| 18786 // NonErrorResolverTest.dartSuite(); | 19384 // NonErrorResolverTest.dartSuite(); |
| 18787 // SimpleResolverTest.dartSuite(); | 19385 // SimpleResolverTest.dartSuite(); |
| 18788 // StaticTypeWarningCodeTest.dartSuite(); | 19386 // StaticTypeWarningCodeTest.dartSuite(); |
| 18789 // StaticWarningCodeTest.dartSuite(); | 19387 // StaticWarningCodeTest.dartSuite(); |
| 18790 // StrictModeTest.dartSuite(); | 19388 // StrictModeTest.dartSuite(); |
| 18791 // TypePropagationTest.dartSuite(); | 19389 // TypePropagationTest.dartSuite(); |
| 18792 } | 19390 } |
| OLD | NEW |