OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer.test.generated.non_error_resolver_test; | 5 library analyzer.test.generated.non_error_resolver_test; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
10 import 'package:analyzer/src/generated/error.dart'; | 10 import 'package:analyzer/src/generated/error.dart'; |
(...skipping 2809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2820 g = () => 0; | 2820 g = () => 0; |
2821 }'''); | 2821 }'''); |
2822 computeLibrarySourceErrors(source); | 2822 computeLibrarySourceErrors(source); |
2823 assertNoErrors(source); | 2823 assertNoErrors(source); |
2824 verify([source]); | 2824 verify([source]); |
2825 } | 2825 } |
2826 | 2826 |
2827 void test_invalidFactoryNameNotAClass() { | 2827 void test_invalidFactoryNameNotAClass() { |
2828 Source source = addSource(r''' | 2828 Source source = addSource(r''' |
2829 class A { | 2829 class A { |
2830 factory A() {} | 2830 factory A() => null; |
2831 }'''); | 2831 }'''); |
2832 computeLibrarySourceErrors(source); | 2832 computeLibrarySourceErrors(source); |
2833 assertNoErrors(source); | 2833 assertNoErrors(source); |
2834 verify([source]); | 2834 verify([source]); |
2835 } | 2835 } |
2836 | 2836 |
2837 void test_invalidIdentifierInAsync() { | 2837 void test_invalidIdentifierInAsync() { |
2838 Source source = addSource(r''' | 2838 Source source = addSource(r''' |
2839 class A { | 2839 class A { |
2840 m() { | 2840 m() { |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3484 } | 3484 } |
3485 class B extends Object with A {}'''); | 3485 class B extends Object with A {}'''); |
3486 computeLibrarySourceErrors(source); | 3486 computeLibrarySourceErrors(source); |
3487 assertNoErrors(source); | 3487 assertNoErrors(source); |
3488 verify([source]); | 3488 verify([source]); |
3489 } | 3489 } |
3490 | 3490 |
3491 void test_mixinDeclaresConstructor_factory() { | 3491 void test_mixinDeclaresConstructor_factory() { |
3492 Source source = addSource(r''' | 3492 Source source = addSource(r''' |
3493 class A { | 3493 class A { |
3494 factory A() {} | 3494 factory A() => null; |
3495 } | 3495 } |
3496 class B extends Object with A {}'''); | 3496 class B extends Object with A {}'''); |
3497 computeLibrarySourceErrors(source); | 3497 computeLibrarySourceErrors(source); |
3498 assertNoErrors(source); | 3498 assertNoErrors(source); |
3499 verify([source]); | 3499 verify([source]); |
3500 } | 3500 } |
3501 | 3501 |
3502 void test_mixinInheritsFromNotObject_classDeclaration_extends() { | 3502 void test_mixinInheritsFromNotObject_classDeclaration_extends() { |
3503 AnalysisOptionsImpl options = new AnalysisOptionsImpl(); | 3503 AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
3504 options.enableSuperMixins = true; | 3504 options.enableSuperMixins = true; |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4268 }'''); | 4268 }'''); |
4269 computeLibrarySourceErrors(source); | 4269 computeLibrarySourceErrors(source); |
4270 assertNoErrors(source); | 4270 assertNoErrors(source); |
4271 verify([source]); | 4271 verify([source]); |
4272 } | 4272 } |
4273 | 4273 |
4274 void test_nonGenerativeConstructor() { | 4274 void test_nonGenerativeConstructor() { |
4275 Source source = addSource(r''' | 4275 Source source = addSource(r''' |
4276 class A { | 4276 class A { |
4277 A.named() {} | 4277 A.named() {} |
4278 factory A() {} | 4278 factory A() => null; |
4279 } | 4279 } |
4280 class B extends A { | 4280 class B extends A { |
4281 B() : super.named(); | 4281 B() : super.named(); |
4282 }'''); | 4282 }'''); |
4283 computeLibrarySourceErrors(source); | 4283 computeLibrarySourceErrors(source); |
4284 assertNoErrors(source); | 4284 assertNoErrors(source); |
4285 verify([source]); | 4285 verify([source]); |
4286 } | 4286 } |
4287 | 4287 |
4288 void test_nonTypeInCatchClause_isClass() { | 4288 void test_nonTypeInCatchClause_isClass() { |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4686 | 4686 |
4687 void test_recursiveFactoryRedirect() { | 4687 void test_recursiveFactoryRedirect() { |
4688 Source source = addSource(r''' | 4688 Source source = addSource(r''' |
4689 class A { | 4689 class A { |
4690 factory A() = B; | 4690 factory A() = B; |
4691 } | 4691 } |
4692 class B implements A { | 4692 class B implements A { |
4693 factory B() = C; | 4693 factory B() = C; |
4694 } | 4694 } |
4695 class C implements B { | 4695 class C implements B { |
4696 factory C() {} | 4696 factory C() => null; |
4697 }'''); | 4697 }'''); |
4698 computeLibrarySourceErrors(source); | 4698 computeLibrarySourceErrors(source); |
4699 assertNoErrors(source); | 4699 assertNoErrors(source); |
4700 verify([source]); | 4700 verify([source]); |
4701 } | 4701 } |
4702 | 4702 |
4703 void test_redirectToInvalidFunctionType() { | 4703 void test_redirectToInvalidFunctionType() { |
4704 Source source = addSource(r''' | 4704 Source source = addSource(r''' |
4705 class A implements B { | 4705 class A implements B { |
4706 A(int p) {} | 4706 A(int p) {} |
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6068 reset(); | 6068 reset(); |
6069 } | 6069 } |
6070 | 6070 |
6071 void _check_wrongNumberOfParametersForOperator1(String name) { | 6071 void _check_wrongNumberOfParametersForOperator1(String name) { |
6072 _check_wrongNumberOfParametersForOperator(name, "a"); | 6072 _check_wrongNumberOfParametersForOperator(name, "a"); |
6073 } | 6073 } |
6074 | 6074 |
6075 CompilationUnit _getResolvedLibraryUnit(Source source) => | 6075 CompilationUnit _getResolvedLibraryUnit(Source source) => |
6076 analysisContext.getResolvedCompilationUnit2(source, source); | 6076 analysisContext.getResolvedCompilationUnit2(source, source); |
6077 } | 6077 } |
OLD | NEW |