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/error/error.dart'; | 9 import 'package:analyzer/error/error.dart'; |
10 import 'package:analyzer/src/error/codes.dart'; | 10 import 'package:analyzer/src/error/codes.dart'; |
(...skipping 3146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3157 class B extends A { | 3157 class B extends A { |
3158 g() { | 3158 g() { |
3159 f(); | 3159 f(); |
3160 } | 3160 } |
3161 }'''); | 3161 }'''); |
3162 computeLibrarySourceErrors(source); | 3162 computeLibrarySourceErrors(source); |
3163 assertNoErrors(source); | 3163 assertNoErrors(source); |
3164 verify([source]); | 3164 verify([source]); |
3165 } | 3165 } |
3166 | 3166 |
| 3167 void test_invocationOfNonFunction_functionTypeTypeParameter() { |
| 3168 Source source = addSource(r''' |
| 3169 typedef void Action<T>(T x); |
| 3170 class C<T, U extends Action<T>> { |
| 3171 T value; |
| 3172 U action; |
| 3173 C(this.value, [this.action]); |
| 3174 void act() { |
| 3175 action(value); |
| 3176 } |
| 3177 } |
| 3178 '''); |
| 3179 computeLibrarySourceErrors(source); |
| 3180 assertNoErrors(source); |
| 3181 verify([source]); |
| 3182 } |
| 3183 |
3167 void test_invocationOfNonFunction_getter() { | 3184 void test_invocationOfNonFunction_getter() { |
3168 Source source = addSource(r''' | 3185 Source source = addSource(r''' |
3169 class A { | 3186 class A { |
3170 var g; | 3187 var g; |
3171 } | 3188 } |
3172 f() { | 3189 f() { |
3173 A a; | 3190 A a; |
3174 a.g(); | 3191 a.g(); |
3175 }'''); | 3192 }'''); |
3176 computeLibrarySourceErrors(source); | 3193 computeLibrarySourceErrors(source); |
(...skipping 2941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6118 reset(); | 6135 reset(); |
6119 } | 6136 } |
6120 | 6137 |
6121 void _check_wrongNumberOfParametersForOperator1(String name) { | 6138 void _check_wrongNumberOfParametersForOperator1(String name) { |
6122 _check_wrongNumberOfParametersForOperator(name, "a"); | 6139 _check_wrongNumberOfParametersForOperator(name, "a"); |
6123 } | 6140 } |
6124 | 6141 |
6125 CompilationUnit _getResolvedLibraryUnit(Source source) => | 6142 CompilationUnit _getResolvedLibraryUnit(Source source) => |
6126 analysisContext.getResolvedCompilationUnit2(source, source); | 6143 analysisContext.getResolvedCompilationUnit2(source, source); |
6127 } | 6144 } |
OLD | NEW |