Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library test.src.serialization.elements_test; | 5 library test.src.serialization.elements_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/constant/value.dart'; | 8 import 'package:analyzer/dart/constant/value.dart'; |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
| (...skipping 3238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3249 checkLibrary('f() {} g() {}'); | 3249 checkLibrary('f() {} g() {}'); |
| 3250 } | 3250 } |
| 3251 | 3251 |
| 3252 test_generic_gClass_gMethodStatic() { | 3252 test_generic_gClass_gMethodStatic() { |
| 3253 prepareAnalysisContext(createOptions()); | 3253 prepareAnalysisContext(createOptions()); |
| 3254 checkLibrary(''' | 3254 checkLibrary(''' |
| 3255 class C<T, U> { | 3255 class C<T, U> { |
| 3256 static void m<V, W>(V v, W w) { | 3256 static void m<V, W>(V v, W w) { |
| 3257 void f<X, Y>(V v, W w, X x, Y y) { | 3257 void f<X, Y>(V v, W w, X x, Y y) { |
| 3258 } | 3258 } |
| 3259 print(f); | |
|
scheglov
2016/11/22 19:13:24
It might be cleaner to filter out "unused X" error
Paul Berry
2016/11/22 20:51:53
Good point. Done.
| |
| 3259 } | 3260 } |
| 3260 } | 3261 } |
| 3261 '''); | 3262 '''); |
| 3262 } | 3263 } |
| 3263 | 3264 |
| 3264 test_getElement_constructor_named() { | 3265 test_getElement_constructor_named() { |
| 3265 String text = 'class C { C.named(); }'; | 3266 String text = 'class C { C.named(); }'; |
| 3266 Source source = addLibrarySource('/test.dart', text); | 3267 Source source = addLibrarySource('/test.dart', text); |
| 3267 ConstructorElement original = context | 3268 ConstructorElement original = context |
| 3268 .computeLibraryElement(source) | 3269 .computeLibraryElement(source) |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3458 addLibrarySource('/b.dart', 'library b; class D {}'); | 3459 addLibrarySource('/b.dart', 'library b; class D {}'); |
| 3459 checkLibrary('import "a.dart"; import "b.dart"; C c; D d;'); | 3460 checkLibrary('import "a.dart"; import "b.dart"; C c; D d;'); |
| 3460 } | 3461 } |
| 3461 | 3462 |
| 3462 test_inferred_function_type_for_variable_in_generic_function() { | 3463 test_inferred_function_type_for_variable_in_generic_function() { |
| 3463 // In the code below, `x` has an inferred type of `() => int`, with 2 | 3464 // In the code below, `x` has an inferred type of `() => int`, with 2 |
| 3464 // (unused) type parameters from the enclosing top level function. | 3465 // (unused) type parameters from the enclosing top level function. |
| 3465 checkLibrary(''' | 3466 checkLibrary(''' |
| 3466 f<U, V>() { | 3467 f<U, V>() { |
| 3467 var x = () => 0; | 3468 var x = () => 0; |
| 3469 print(x); | |
| 3468 } | 3470 } |
| 3469 '''); | 3471 '''); |
| 3470 } | 3472 } |
| 3471 | 3473 |
| 3472 test_inferred_function_type_in_generic_class_constructor() { | 3474 test_inferred_function_type_in_generic_class_constructor() { |
| 3473 // In the code below, `() => () => 0` has an inferred return type of | 3475 // In the code below, `() => () => 0` has an inferred return type of |
| 3474 // `() => int`, with 2 (unused) type parameters from the enclosing class. | 3476 // `() => int`, with 2 (unused) type parameters from the enclosing class. |
| 3475 checkLibrary(''' | 3477 checkLibrary(''' |
| 3476 class C<U, V> { | 3478 class C<U, V> { |
| 3477 final x; | 3479 final x; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3623 | 3625 |
| 3624 test_initializer_executable_with_return_type_from_closure_field() { | 3626 test_initializer_executable_with_return_type_from_closure_field() { |
| 3625 checkLibrary(''' | 3627 checkLibrary(''' |
| 3626 class C { | 3628 class C { |
| 3627 var v = () => 0; | 3629 var v = () => 0; |
| 3628 } | 3630 } |
| 3629 '''); | 3631 '''); |
| 3630 } | 3632 } |
| 3631 | 3633 |
| 3632 test_initializer_executable_with_return_type_from_closure_local() { | 3634 test_initializer_executable_with_return_type_from_closure_local() { |
| 3633 checkLibrary(''' | 3635 checkLibrary(r''' |
| 3634 void f() { | 3636 void f() { |
| 3635 int u = 0; | 3637 int u = 0; |
| 3636 var v = () => 0; | 3638 var v = () => 0; |
| 3639 print('$u$v'); | |
| 3637 } | 3640 } |
| 3638 '''); | 3641 '''); |
| 3639 } | 3642 } |
| 3640 | 3643 |
| 3641 test_instantiateToBounds_boundRefersToEarlierTypeArgument() { | 3644 test_instantiateToBounds_boundRefersToEarlierTypeArgument() { |
| 3642 checkLibrary(''' | 3645 checkLibrary(''' |
| 3643 class C<S extends num, T extends C<S, T>> {} | 3646 class C<S extends num, T extends C<S, T>> {} |
| 3644 C c; | 3647 C c; |
| 3645 '''); | 3648 '''); |
| 3646 } | 3649 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3690 test_library_named() { | 3693 test_library_named() { |
| 3691 checkLibrary('library foo.bar;'); | 3694 checkLibrary('library foo.bar;'); |
| 3692 } | 3695 } |
| 3693 | 3696 |
| 3694 test_localFunctions() { | 3697 test_localFunctions() { |
| 3695 checkLibrary(r''' | 3698 checkLibrary(r''' |
| 3696 f() { | 3699 f() { |
| 3697 f1() {} | 3700 f1() {} |
| 3698 { | 3701 { |
| 3699 f2() {} | 3702 f2() {} |
| 3703 print(f2); | |
| 3700 } | 3704 } |
| 3705 print(f1); | |
| 3701 } | 3706 } |
| 3702 '''); | 3707 '''); |
| 3703 } | 3708 } |
| 3704 | 3709 |
| 3705 test_localFunctions_inConstructor() { | 3710 test_localFunctions_inConstructor() { |
| 3706 checkLibrary(r''' | 3711 checkLibrary(r''' |
| 3707 class C { | 3712 class C { |
| 3708 C() { | 3713 C() { |
| 3709 f() {} | 3714 f() {} |
| 3715 print(f); | |
| 3710 } | 3716 } |
| 3711 } | 3717 } |
| 3712 '''); | 3718 '''); |
| 3713 } | 3719 } |
| 3714 | 3720 |
| 3715 test_localFunctions_inMethod() { | 3721 test_localFunctions_inMethod() { |
| 3716 checkLibrary(r''' | 3722 checkLibrary(r''' |
| 3717 class C { | 3723 class C { |
| 3718 m() { | 3724 m() { |
| 3719 f() {} | 3725 f() {} |
| 3726 print(f); | |
| 3720 } | 3727 } |
| 3721 } | 3728 } |
| 3722 '''); | 3729 '''); |
| 3723 } | 3730 } |
| 3724 | 3731 |
| 3725 test_localFunctions_inTopLevelGetter() { | 3732 test_localFunctions_inTopLevelGetter() { |
| 3726 checkLibrary(r''' | 3733 checkLibrary(r''' |
| 3727 get g { | 3734 get g { |
| 3728 f() {} | 3735 f() {} |
| 3736 print(f); | |
| 3729 } | 3737 } |
| 3730 '''); | 3738 '''); |
| 3731 } | 3739 } |
| 3732 | 3740 |
| 3733 test_localLabels_inConstructor() { | 3741 test_localLabels_inConstructor() { |
| 3734 checkLibrary( | 3742 checkLibrary( |
| 3735 r''' | 3743 r''' |
| 3736 class C { | 3744 class C { |
| 3737 C() { | 3745 C() { |
| 3738 aaa: while (true) {} | 3746 aaa: while (true) {} |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3774 } | 3782 } |
| 3775 ''', | 3783 ''', |
| 3776 allowErrors: true); | 3784 allowErrors: true); |
| 3777 } | 3785 } |
| 3778 | 3786 |
| 3779 test_localVariables_inConstructor() { | 3787 test_localVariables_inConstructor() { |
| 3780 checkLibrary(r''' | 3788 checkLibrary(r''' |
| 3781 class C { | 3789 class C { |
| 3782 C() { | 3790 C() { |
| 3783 int v; | 3791 int v; |
| 3792 print(v); | |
| 3784 f() {} | 3793 f() {} |
| 3794 print(f); | |
| 3785 } | 3795 } |
| 3786 } | 3796 } |
| 3787 '''); | 3797 '''); |
| 3788 } | 3798 } |
| 3789 | 3799 |
| 3790 test_localVariables_inLocalFunction() { | 3800 test_localVariables_inLocalFunction() { |
| 3791 checkLibrary(r''' | 3801 checkLibrary(r''' |
| 3792 f() { | 3802 f() { |
| 3793 f1() { | 3803 f1() { |
| 3794 int v1 = 1; | 3804 int v1 = 1; |
| 3805 print(v1); | |
| 3795 } // 2 | 3806 } // 2 |
| 3807 print(f1); | |
| 3796 f2() { | 3808 f2() { |
| 3797 int v1 = 1; | 3809 int v1 = 1; |
| 3810 print(v1); | |
| 3798 f3() { | 3811 f3() { |
| 3799 int v2 = 1; | 3812 int v2 = 1; |
| 3813 print(v2); | |
| 3800 } | 3814 } |
| 3815 print(f3); | |
| 3801 } | 3816 } |
| 3817 print(f2); | |
| 3802 } | 3818 } |
| 3803 '''); | 3819 '''); |
| 3804 } | 3820 } |
| 3805 | 3821 |
| 3806 test_localVariables_inMethod() { | 3822 test_localVariables_inMethod() { |
| 3807 checkLibrary(r''' | 3823 checkLibrary(r''' |
| 3808 class C { | 3824 class C { |
| 3809 m() { | 3825 m() { |
| 3810 int v; | 3826 int v; |
| 3827 print(v); | |
| 3811 } | 3828 } |
| 3812 } | 3829 } |
| 3813 '''); | 3830 '''); |
| 3814 } | 3831 } |
| 3815 | 3832 |
| 3816 test_localVariables_inTopLevelFunction() { | 3833 test_localVariables_inTopLevelFunction() { |
| 3817 checkLibrary(r''' | 3834 checkLibrary(r''' |
| 3818 main() { | 3835 main() { |
| 3819 int v1 = 1; | 3836 int v1 = 1; |
| 3837 print(v1); | |
| 3820 { | 3838 { |
| 3821 const String v2 = 'bbb'; | 3839 const String v2 = 'bbb'; |
| 3840 print(v2); | |
| 3822 } | 3841 } |
| 3823 Map<int, List<double>> v3; | 3842 Map<int, List<double>> v3; |
| 3843 print(v3); | |
| 3824 } | 3844 } |
| 3825 '''); | 3845 '''); |
| 3826 } | 3846 } |
| 3827 | 3847 |
| 3828 test_localVariables_inTopLevelGetter() { | 3848 test_localVariables_inTopLevelGetter() { |
| 3829 checkLibrary(r''' | 3849 checkLibrary(r''' |
| 3830 get g { | 3850 get g { |
| 3831 int v; | 3851 int v; |
| 3852 print(v); | |
| 3832 } | 3853 } |
| 3833 '''); | 3854 '''); |
| 3834 } | 3855 } |
| 3835 | 3856 |
| 3836 test_main_class() { | 3857 test_main_class() { |
| 3837 checkLibrary('class main {}'); | 3858 checkLibrary('class main {}'); |
| 3838 } | 3859 } |
| 3839 | 3860 |
| 3840 test_main_class_alias() { | 3861 test_main_class_alias() { |
| 3841 checkLibrary('class main = C with D; class C {} class D {}'); | 3862 checkLibrary('class main = C with D; class C {} class D {}'); |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4090 prepareAnalysisContext(createOptions()); | 4111 prepareAnalysisContext(createOptions()); |
| 4091 checkLibrary('class C { void f<T, U>(T x(U u)) {} }'); | 4112 checkLibrary('class C { void f<T, U>(T x(U u)) {} }'); |
| 4092 } | 4113 } |
| 4093 | 4114 |
| 4094 test_nested_generic_functions_in_generic_class_with_function_typed_params() { | 4115 test_nested_generic_functions_in_generic_class_with_function_typed_params() { |
| 4095 checkLibrary(''' | 4116 checkLibrary(''' |
| 4096 class C<T, U> { | 4117 class C<T, U> { |
| 4097 void g<V, W>() { | 4118 void g<V, W>() { |
| 4098 void h<X, Y>(void p(T t, U u, V v, W w, X x, Y y)) { | 4119 void h<X, Y>(void p(T t, U u, V v, W w, X x, Y y)) { |
| 4099 } | 4120 } |
| 4121 print(h); | |
| 4100 } | 4122 } |
| 4101 } | 4123 } |
| 4102 '''); | 4124 '''); |
| 4103 } | 4125 } |
| 4104 | 4126 |
| 4105 test_nested_generic_functions_in_generic_class_with_local_variables() { | 4127 test_nested_generic_functions_in_generic_class_with_local_variables() { |
| 4106 checkLibrary(''' | 4128 checkLibrary(r''' |
| 4107 class C<T, U> { | 4129 class C<T, U> { |
| 4108 void g<V, W>() { | 4130 void g<V, W>() { |
| 4109 void h<X, Y>() { | 4131 void h<X, Y>() { |
| 4110 T t; | 4132 T t; |
| 4111 U u; | 4133 U u; |
| 4112 V v; | 4134 V v; |
| 4113 W w; | 4135 W w; |
| 4114 X x; | 4136 X x; |
| 4115 Y y; | 4137 Y y; |
| 4138 print('$t$u$v$w$x$y'); | |
| 4116 } | 4139 } |
| 4140 print(h); | |
| 4117 } | 4141 } |
| 4118 } | 4142 } |
| 4119 '''); | 4143 '''); |
| 4120 } | 4144 } |
| 4121 | 4145 |
| 4122 test_nested_generic_functions_with_function_typed_param() { | 4146 test_nested_generic_functions_with_function_typed_param() { |
| 4123 checkLibrary(''' | 4147 checkLibrary(''' |
| 4124 void f<T, U>() { | 4148 void f<T, U>() { |
| 4125 void g<V, W>() { | 4149 void g<V, W>() { |
| 4126 void h<X, Y>(void p(T t, U u, V v, W w, X x, Y y)) { | 4150 void h<X, Y>(void p(T t, U u, V v, W w, X x, Y y)) { |
| 4127 } | 4151 } |
| 4152 print(h); | |
| 4128 } | 4153 } |
| 4154 print(g); | |
| 4129 } | 4155 } |
| 4130 '''); | 4156 '''); |
| 4131 } | 4157 } |
| 4132 | 4158 |
| 4133 test_nested_generic_functions_with_local_variables() { | 4159 test_nested_generic_functions_with_local_variables() { |
| 4134 checkLibrary(''' | 4160 checkLibrary(r''' |
| 4135 void f<T, U>() { | 4161 void f<T, U>() { |
| 4136 void g<V, W>() { | 4162 void g<V, W>() { |
| 4137 void h<X, Y>() { | 4163 void h<X, Y>() { |
| 4138 T t; | 4164 T t; |
| 4139 U u; | 4165 U u; |
| 4140 V v; | 4166 V v; |
| 4141 W w; | 4167 W w; |
| 4142 X x; | 4168 X x; |
| 4143 Y y; | 4169 Y y; |
| 4170 print('$t$u$v$w$x$y'); | |
| 4144 } | 4171 } |
| 4172 print(h); | |
| 4145 } | 4173 } |
| 4174 print(g); | |
| 4146 } | 4175 } |
| 4147 '''); | 4176 '''); |
| 4148 } | 4177 } |
| 4149 | 4178 |
| 4150 test_operator() { | 4179 test_operator() { |
| 4151 checkLibrary('class C { C operator+(C other) => null; }'); | 4180 checkLibrary('class C { C operator+(C other) => null; }'); |
| 4152 } | 4181 } |
| 4153 | 4182 |
| 4154 test_operator_equal() { | 4183 test_operator_equal() { |
| 4155 checkLibrary('class C { bool operator==(Object other) => false; }'); | 4184 checkLibrary('class C { bool operator==(Object other) => false; }'); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4223 addSource('/a.dart', 'part of my.lib;'); | 4252 addSource('/a.dart', 'part of my.lib;'); |
| 4224 addSource('/b.dart', 'part of my.lib;'); | 4253 addSource('/b.dart', 'part of my.lib;'); |
| 4225 checkLibrary('library my.lib; part "a.dart"; part "b.dart";'); | 4254 checkLibrary('library my.lib; part "a.dart"; part "b.dart";'); |
| 4226 } | 4255 } |
| 4227 | 4256 |
| 4228 test_propagated_type_refers_to_closure() { | 4257 test_propagated_type_refers_to_closure() { |
| 4229 checkLibrary(''' | 4258 checkLibrary(''' |
| 4230 void f() { | 4259 void f() { |
| 4231 var x = () => 0; | 4260 var x = () => 0; |
| 4232 var y = x; | 4261 var y = x; |
| 4262 print(y); | |
| 4233 } | 4263 } |
| 4234 '''); | 4264 '''); |
| 4235 } | 4265 } |
| 4236 | 4266 |
| 4237 test_setter_documented() { | 4267 test_setter_documented() { |
| 4238 checkLibrary(''' | 4268 checkLibrary(''' |
| 4239 // Extra comment so doc comment offset != 0 | 4269 // Extra comment so doc comment offset != 0 |
| 4240 /** | 4270 /** |
| 4241 * Docs | 4271 * Docs |
| 4242 */ | 4272 */ |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4286 // method syntax doesn't support generic closures. So it can only run in | 4316 // method syntax doesn't support generic closures. So it can only run in |
| 4287 // strong mode. | 4317 // strong mode. |
| 4288 // TODO(paulberry): once proper generic method syntax supports generic | 4318 // TODO(paulberry): once proper generic method syntax supports generic |
| 4289 // closures, rewrite the test below without using generic comment syntax, | 4319 // closures, rewrite the test below without using generic comment syntax, |
| 4290 // and remove this hack. See dartbug.com/25819 | 4320 // and remove this hack. See dartbug.com/25819 |
| 4291 return; | 4321 return; |
| 4292 } | 4322 } |
| 4293 checkLibrary(''' | 4323 checkLibrary(''' |
| 4294 void f<T, U>(bool b) { | 4324 void f<T, U>(bool b) { |
| 4295 final v = b ? /*<V>*/(T t, U u, V v) => 0 : /*<V>*/(T t, U u, V v) => 1; | 4325 final v = b ? /*<V>*/(T t, U u, V v) => 0 : /*<V>*/(T t, U u, V v) => 1; |
| 4326 print(v); | |
| 4296 } | 4327 } |
| 4297 '''); | 4328 '''); |
| 4298 } | 4329 } |
| 4299 | 4330 |
| 4300 test_syntheticFunctionType_inGenericClass() { | 4331 test_syntheticFunctionType_inGenericClass() { |
| 4301 checkLibrary(''' | 4332 checkLibrary(''' |
| 4302 class C<T, U> { | 4333 class C<T, U> { |
| 4303 var v = f() ? (T t, U u) => 0 : (T t, U u) => 1; | 4334 var v = f() ? (T t, U u) => 0 : (T t, U u) => 1; |
| 4304 } | 4335 } |
| 4305 bool f() => false; | 4336 bool f() => false; |
| 4306 '''); | 4337 '''); |
| 4307 } | 4338 } |
| 4308 | 4339 |
| 4309 test_syntheticFunctionType_inGenericFunction() { | 4340 test_syntheticFunctionType_inGenericFunction() { |
| 4310 checkLibrary(''' | 4341 checkLibrary(''' |
| 4311 void f<T, U>(bool b) { | 4342 void f<T, U>(bool b) { |
| 4312 var v = b ? (T t, U u) => 0 : (T t, U u) => 1; | 4343 var v = b ? (T t, U u) => 0 : (T t, U u) => 1; |
| 4344 print(v); | |
| 4313 } | 4345 } |
| 4314 '''); | 4346 '''); |
| 4315 } | 4347 } |
| 4316 | 4348 |
| 4317 test_syntheticFunctionType_noArguments() { | 4349 test_syntheticFunctionType_noArguments() { |
| 4318 checkLibrary(''' | 4350 checkLibrary(''' |
| 4319 final v = f() ? () => 0 : () => 1; | 4351 final v = f() ? () => 0 : () => 1; |
| 4320 bool f() => true; | 4352 bool f() => true; |
| 4321 '''); | 4353 '''); |
| 4322 } | 4354 } |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4533 | 4565 |
| 4534 test_typedef_type_parameters_f_bound_simple() { | 4566 test_typedef_type_parameters_f_bound_simple() { |
| 4535 checkLibrary('typedef U F<T extends U, U>(T t);'); | 4567 checkLibrary('typedef U F<T extends U, U>(T t);'); |
| 4536 } | 4568 } |
| 4537 | 4569 |
| 4538 test_typedefs() { | 4570 test_typedefs() { |
| 4539 checkLibrary('f() {} g() {}'); | 4571 checkLibrary('f() {} g() {}'); |
| 4540 } | 4572 } |
| 4541 | 4573 |
| 4542 test_unresolved_annotation_namedConstructorCall_noClass() { | 4574 test_unresolved_annotation_namedConstructorCall_noClass() { |
| 4543 checkLibrary('@foo.bar() class C {}'); | 4575 checkLibrary('@foo.bar() class C {}', allowErrors: true); |
| 4544 } | 4576 } |
| 4545 | 4577 |
| 4546 test_unresolved_annotation_namedConstructorCall_noConstructor() { | 4578 test_unresolved_annotation_namedConstructorCall_noConstructor() { |
| 4547 checkLibrary('@String.foo() class C {}'); | 4579 checkLibrary('@String.foo() class C {}', allowErrors: true); |
| 4548 } | 4580 } |
| 4549 | 4581 |
| 4550 test_unresolved_annotation_prefixedIdentifier_badPrefix() { | 4582 test_unresolved_annotation_prefixedIdentifier_badPrefix() { |
| 4551 checkLibrary('@foo.bar class C {}'); | 4583 checkLibrary('@foo.bar class C {}', allowErrors: true); |
| 4552 } | 4584 } |
| 4553 | 4585 |
| 4554 test_unresolved_annotation_prefixedIdentifier_noDeclaration() { | 4586 test_unresolved_annotation_prefixedIdentifier_noDeclaration() { |
| 4555 checkLibrary('import "dart:async" as foo; @foo.bar class C {}'); | 4587 checkLibrary('import "dart:async" as foo; @foo.bar class C {}', |
| 4588 allowErrors: true); | |
| 4556 } | 4589 } |
| 4557 | 4590 |
| 4558 test_unresolved_annotation_prefixedNamedConstructorCall_badPrefix() { | 4591 test_unresolved_annotation_prefixedNamedConstructorCall_badPrefix() { |
| 4559 checkLibrary('@foo.bar.baz() class C {}'); | 4592 checkLibrary('@foo.bar.baz() class C {}', allowErrors: true); |
| 4560 } | 4593 } |
| 4561 | 4594 |
| 4562 test_unresolved_annotation_prefixedNamedConstructorCall_noClass() { | 4595 test_unresolved_annotation_prefixedNamedConstructorCall_noClass() { |
| 4563 checkLibrary('import "dart:async" as foo; @foo.bar.baz() class C {}'); | 4596 checkLibrary('import "dart:async" as foo; @foo.bar.baz() class C {}', |
| 4597 allowErrors: true); | |
| 4564 } | 4598 } |
| 4565 | 4599 |
| 4566 test_unresolved_annotation_prefixedNamedConstructorCall_noConstructor() { | 4600 test_unresolved_annotation_prefixedNamedConstructorCall_noConstructor() { |
| 4567 checkLibrary('import "dart:async" as foo; @foo.Future.bar() class C {}'); | 4601 checkLibrary('import "dart:async" as foo; @foo.Future.bar() class C {}', |
| 4602 allowErrors: true); | |
| 4568 } | 4603 } |
| 4569 | 4604 |
| 4570 test_unresolved_annotation_prefixedUnnamedConstructorCall_badPrefix() { | 4605 test_unresolved_annotation_prefixedUnnamedConstructorCall_badPrefix() { |
| 4571 checkLibrary('@foo.bar() class C {}'); | 4606 checkLibrary('@foo.bar() class C {}', allowErrors: true); |
| 4572 } | 4607 } |
| 4573 | 4608 |
| 4574 test_unresolved_annotation_prefixedUnnamedConstructorCall_noClass() { | 4609 test_unresolved_annotation_prefixedUnnamedConstructorCall_noClass() { |
| 4575 checkLibrary('import "dart:async" as foo; @foo.bar() class C {}'); | 4610 checkLibrary('import "dart:async" as foo; @foo.bar() class C {}', |
| 4611 allowErrors: true); | |
| 4576 } | 4612 } |
| 4577 | 4613 |
| 4578 test_unresolved_annotation_simpleIdentifier() { | 4614 test_unresolved_annotation_simpleIdentifier() { |
| 4579 checkLibrary('@foo class C {}'); | 4615 checkLibrary('@foo class C {}', allowErrors: true); |
| 4580 } | 4616 } |
| 4581 | 4617 |
| 4582 test_unresolved_annotation_unnamedConstructorCall_noClass() { | 4618 test_unresolved_annotation_unnamedConstructorCall_noClass() { |
| 4583 checkLibrary('@foo() class C {}'); | 4619 checkLibrary('@foo() class C {}', allowErrors: true); |
| 4584 } | 4620 } |
| 4585 | 4621 |
| 4586 test_unresolved_export() { | 4622 test_unresolved_export() { |
| 4587 allowMissingFiles = true; | 4623 allowMissingFiles = true; |
| 4588 checkLibrary("export 'foo.dart';", allowErrors: true); | 4624 checkLibrary("export 'foo.dart';", allowErrors: true); |
| 4589 } | 4625 } |
| 4590 | 4626 |
| 4591 test_unresolved_import() { | 4627 test_unresolved_import() { |
| 4592 allowMissingFiles = true; | 4628 allowMissingFiles = true; |
| 4593 checkLibrary("import 'foo.dart';", allowErrors: true); | 4629 checkLibrary("import 'foo.dart';", allowErrors: true); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4747 fail('Unexpectedly tried to get unlinked summary for $uri'); | 4783 fail('Unexpectedly tried to get unlinked summary for $uri'); |
| 4748 } | 4784 } |
| 4749 return serializedUnit; | 4785 return serializedUnit; |
| 4750 } | 4786 } |
| 4751 | 4787 |
| 4752 @override | 4788 @override |
| 4753 bool hasLibrarySummary(String uri) { | 4789 bool hasLibrarySummary(String uri) { |
| 4754 return true; | 4790 return true; |
| 4755 } | 4791 } |
| 4756 } | 4792 } |
| OLD | NEW |