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 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
(...skipping 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2151 class A { | 2151 class A { |
2152 noSuchMethod(inv) {} | 2152 noSuchMethod(inv) {} |
2153 } | 2153 } |
2154 class B extends A implements Function { | 2154 class B extends A implements Function { |
2155 }'''); | 2155 }'''); |
2156 await computeAnalysisResult(source); | 2156 await computeAnalysisResult(source); |
2157 assertNoErrors(source); | 2157 assertNoErrors(source); |
2158 verify([source]); | 2158 verify([source]); |
2159 } | 2159 } |
2160 | 2160 |
| 2161 test_genericTypeAlias_noTypeParameters() async { |
| 2162 Source source = addSource(r''' |
| 2163 typedef Foo = int Function<T>(T x); |
| 2164 int foo<T>(T x) => 3; |
| 2165 void test1() { |
| 2166 Foo y = foo; |
| 2167 // These two should be equivalent |
| 2168 foo<String>("hello"); |
| 2169 y<String>("hello"); |
| 2170 } |
| 2171 '''); |
| 2172 await computeAnalysisResult(source); |
| 2173 assertNoErrors(source); |
| 2174 verify([source]); |
| 2175 } |
| 2176 |
| 2177 test_genericTypeAlias_typeParameters() async { |
| 2178 Source source = addSource(r''' |
| 2179 typedef Foo<S> = S Function<T>(T x); |
| 2180 int foo<T>(T x) => 3; |
| 2181 void test1() { |
| 2182 Foo<int> y = foo; |
| 2183 // These two should be equivalent |
| 2184 foo<String>("hello"); |
| 2185 y<String>("hello"); |
| 2186 } |
| 2187 '''); |
| 2188 await computeAnalysisResult(source); |
| 2189 assertNoErrors(source); |
| 2190 verify([source]); |
| 2191 } |
| 2192 |
2161 test_implicitConstructorDependencies() async { | 2193 test_implicitConstructorDependencies() async { |
2162 // No warning should be generated for the code below; this requires that | 2194 // No warning should be generated for the code below; this requires that |
2163 // implicit constructors are generated for C1 before C2, even though C1 | 2195 // implicit constructors are generated for C1 before C2, even though C1 |
2164 // follows C2 in the file. See dartbug.com/21600. | 2196 // follows C2 in the file. See dartbug.com/21600. |
2165 Source source = addSource(r''' | 2197 Source source = addSource(r''' |
2166 class B { | 2198 class B { |
2167 B(int i); | 2199 B(int i); |
2168 } | 2200 } |
2169 class M1 {} | 2201 class M1 {} |
2170 class M2 {} | 2202 class M2 {} |
(...skipping 4076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6247 await computeAnalysisResult(source); | 6279 await computeAnalysisResult(source); |
6248 assertNoErrors(source); | 6280 assertNoErrors(source); |
6249 verify([source]); | 6281 verify([source]); |
6250 reset(); | 6282 reset(); |
6251 } | 6283 } |
6252 | 6284 |
6253 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async { | 6285 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async { |
6254 await _check_wrongNumberOfParametersForOperator(name, "a"); | 6286 await _check_wrongNumberOfParametersForOperator(name, "a"); |
6255 } | 6287 } |
6256 } | 6288 } |
OLD | NEW |