| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 | 7 |
| 8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
| 9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
| 10 import 'package:compiler/src/constants/expressions.dart'; | 10 import 'package:compiler/src/constants/expressions.dart'; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 Expect.equals(index, expectedElements.length); | 164 Expect.equals(index, expectedElements.length); |
| 165 } | 165 } |
| 166 | 166 |
| 167 return Future.wait([ | 167 return Future.wait([ |
| 168 MockCompiler.create((MockCompiler compiler) { | 168 MockCompiler.create((MockCompiler compiler) { |
| 169 ResolverVisitor visitor = compiler.resolverVisitor(); | 169 ResolverVisitor visitor = compiler.resolverVisitor(); |
| 170 compiler.parseScript('class Foo<T, U> {}'); | 170 compiler.parseScript('class Foo<T, U> {}'); |
| 171 LibraryElement mainApp = compiler.mainApp; | 171 LibraryElement mainApp = compiler.mainApp; |
| 172 ClassElement foo = mainApp.find('Foo'); | 172 ClassElement foo = mainApp.find('Foo'); |
| 173 matchResolvedTypes(visitor, 'Foo<int, String> x;', 'Foo', [ | 173 matchResolvedTypes(visitor, 'Foo<int, String> x;', 'Foo', [ |
| 174 compiler.commonElements.intClass, | 174 compiler.resolution.commonElements.intClass, |
| 175 compiler.commonElements.stringClass | 175 compiler.resolution.commonElements.stringClass |
| 176 ]); | 176 ]); |
| 177 matchResolvedTypes(visitor, 'Foo<Foo, Foo> x;', 'Foo', [foo, foo]); | 177 matchResolvedTypes(visitor, 'Foo<Foo, Foo> x;', 'Foo', [foo, foo]); |
| 178 }), | 178 }), |
| 179 MockCompiler.create((MockCompiler compiler) { | 179 MockCompiler.create((MockCompiler compiler) { |
| 180 compiler.parseScript('class Foo<T, U> {}'); | 180 compiler.parseScript('class Foo<T, U> {}'); |
| 181 compiler.resolveStatement('Foo<notype, int> x;'); | 181 compiler.resolveStatement('Foo<notype, int> x;'); |
| 182 DiagnosticCollector collector = compiler.diagnosticCollector; | 182 DiagnosticCollector collector = compiler.diagnosticCollector; |
| 183 Expect.equals(1, collector.warnings.length); | 183 Expect.equals(1, collector.warnings.length); |
| 184 Expect.equals(MessageKind.CANNOT_RESOLVE_TYPE, | 184 Expect.equals(MessageKind.CANNOT_RESOLVE_TYPE, |
| 185 collector.warnings.first.message.kind); | 185 collector.warnings.first.message.kind); |
| (...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1568 functionName: 'm'); | 1568 functionName: 'm'); |
| 1569 check( | 1569 check( |
| 1570 ''' | 1570 ''' |
| 1571 class A { | 1571 class A { |
| 1572 m() => () => await - 3; | 1572 m() => () => await - 3; |
| 1573 } | 1573 } |
| 1574 main() => new A().m(); | 1574 main() => new A().m(); |
| 1575 ''', | 1575 ''', |
| 1576 className: 'A'); | 1576 className: 'A'); |
| 1577 } | 1577 } |
| OLD | NEW |