| 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.static_type_warning_code_test; | 5 library analyzer.test.generated.static_type_warning_code_test; |
| 6 | 6 |
| 7 import 'package:analyzer/error/error.dart'; | 7 import 'package:analyzer/error/error.dart'; |
| 8 import 'package:analyzer/src/error/codes.dart'; | 8 import 'package:analyzer/src/error/codes.dart'; |
| 9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
| 10 import 'package:analyzer/src/generated/java_core.dart' show formatList; | 10 import 'package:analyzer/src/generated/java_core.dart' show formatList; |
| (...skipping 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2420 resetWith(options: options); | 2420 resetWith(options: options); |
| 2421 } | 2421 } |
| 2422 | 2422 |
| 2423 test_genericMethodWrongNumberOfTypeArguments() async { | 2423 test_genericMethodWrongNumberOfTypeArguments() async { |
| 2424 Source source = addSource(''' | 2424 Source source = addSource(''' |
| 2425 f() {} | 2425 f() {} |
| 2426 main() { | 2426 main() { |
| 2427 f/*<int>*/(); | 2427 f/*<int>*/(); |
| 2428 } | 2428 } |
| 2429 '''); | 2429 '''); |
| 2430 await computeAnalysisResult(source); | 2430 TestAnalysisResult analysisResult = await computeAnalysisResult(source); |
| 2431 assertErrors( | 2431 assertErrors( |
| 2432 source, [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD]); | 2432 source, [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD]); |
| 2433 for (AnalysisError error in analysisContext2.computeErrors(source)) { | 2433 for (AnalysisError error in analysisResult.errors) { |
| 2434 if (error.errorCode == | 2434 if (error.errorCode == |
| 2435 StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS) { | 2435 StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS) { |
| 2436 expect(error.message, | 2436 expect(error.message, |
| 2437 formatList(error.errorCode.message, ['() → dynamic', 0, 1])); | 2437 formatList(error.errorCode.message, ['() → dynamic', 0, 1])); |
| 2438 } | 2438 } |
| 2439 } | 2439 } |
| 2440 verify([source]); | 2440 verify([source]); |
| 2441 } | 2441 } |
| 2442 | 2442 |
| 2443 test_legalAsyncGeneratorReturnType_function_supertypeOfStream() async { | 2443 test_legalAsyncGeneratorReturnType_function_supertypeOfStream() async { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2480 Object f3() sync* { yield 42; } | 2480 Object f3() sync* { yield 42; } |
| 2481 Iterable f4() sync* { yield 42; } | 2481 Iterable f4() sync* { yield 42; } |
| 2482 Iterable<dynamic> f5() sync* { yield 42; } | 2482 Iterable<dynamic> f5() sync* { yield 42; } |
| 2483 Iterable<Object> f6() sync* { yield 42; } | 2483 Iterable<Object> f6() sync* { yield 42; } |
| 2484 Iterable<num> f7() sync* { yield 42; } | 2484 Iterable<num> f7() sync* { yield 42; } |
| 2485 Iterable<int> f8() sync* { yield 42; } | 2485 Iterable<int> f8() sync* { yield 42; } |
| 2486 ''', | 2486 ''', |
| 2487 []); | 2487 []); |
| 2488 } | 2488 } |
| 2489 } | 2489 } |
| OLD | NEW |