| 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.resolver_test; | 5 library analyzer.test.generated.resolver_test; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| (...skipping 13924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13935 Source source = addSource(r''' | 13935 Source source = addSource(r''' |
| 13936 class C { | 13936 class C { |
| 13937 Iterable/*<T>*/ f/*<T>*/(/*=T*/ x) => null; | 13937 Iterable/*<T>*/ f/*<T>*/(/*=T*/ x) => null; |
| 13938 } | 13938 } |
| 13939 class D extends C { | 13939 class D extends C { |
| 13940 String f/*<S>*/(/*=S*/ x) => null; | 13940 String f/*<S>*/(/*=S*/ x) => null; |
| 13941 }'''); | 13941 }'''); |
| 13942 // TODO(jmesserly): we can't use assertErrors because STRONG_MODE_* errors | 13942 // TODO(jmesserly): we can't use assertErrors because STRONG_MODE_* errors |
| 13943 // from CodeChecker don't have working equality. | 13943 // from CodeChecker don't have working equality. |
| 13944 List<AnalysisError> errors = analysisContext2.computeErrors(source); | 13944 List<AnalysisError> errors = analysisContext2.computeErrors(source); |
| 13945 |
| 13946 // Sort errors by name. |
| 13947 errors.sort((AnalysisError e1, AnalysisError e2) => |
| 13948 e1.errorCode.name.compareTo(e2.errorCode.name)); |
| 13949 |
| 13945 expect(errors.map((e) => e.errorCode.name), [ | 13950 expect(errors.map((e) => e.errorCode.name), [ |
| 13946 'INVALID_METHOD_OVERRIDE_RETURN_TYPE', | 13951 'INVALID_METHOD_OVERRIDE_RETURN_TYPE', |
| 13947 'STRONG_MODE_INVALID_METHOD_OVERRIDE' | 13952 'STRONG_MODE_INVALID_METHOD_OVERRIDE' |
| 13948 ]); | 13953 ]); |
| 13949 expect(errors[0].message, contains('Iterable<S>'), | 13954 expect(errors[0].message, contains('Iterable<S>'), |
| 13950 reason: 'errors should be in terms of the type parameters ' | 13955 reason: 'errors should be in terms of the type parameters ' |
| 13951 'at the error location'); | 13956 'at the error location'); |
| 13952 verify([source]); | 13957 verify([source]); |
| 13953 } | 13958 } |
| 13954 | 13959 |
| (...skipping 3168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17123 | 17128 |
| 17124 void _resolveTestUnit(String code) { | 17129 void _resolveTestUnit(String code) { |
| 17125 testCode = code; | 17130 testCode = code; |
| 17126 testSource = addSource(testCode); | 17131 testSource = addSource(testCode); |
| 17127 LibraryElement library = resolve2(testSource); | 17132 LibraryElement library = resolve2(testSource); |
| 17128 assertNoErrors(testSource); | 17133 assertNoErrors(testSource); |
| 17129 verify([testSource]); | 17134 verify([testSource]); |
| 17130 testUnit = resolveCompilationUnit(testSource, library); | 17135 testUnit = resolveCompilationUnit(testSource, library); |
| 17131 } | 17136 } |
| 17132 } | 17137 } |
| OLD | NEW |