| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 index++; | 157 index++; |
| 158 } | 158 } |
| 159 Expect.equals(index, expectedElements.length); | 159 Expect.equals(index, expectedElements.length); |
| 160 } | 160 } |
| 161 | 161 |
| 162 return Future.wait([ | 162 return Future.wait([ |
| 163 MockCompiler.create((MockCompiler compiler) { | 163 MockCompiler.create((MockCompiler compiler) { |
| 164 ResolverVisitor visitor = compiler.resolverVisitor(); | 164 ResolverVisitor visitor = compiler.resolverVisitor(); |
| 165 compiler.parseScript('class Foo<T, U> {}'); | 165 compiler.parseScript('class Foo<T, U> {}'); |
| 166 ClassElement foo = compiler.mainApp.find('Foo'); | 166 ClassElement foo = compiler.mainApp.find('Foo'); |
| 167 matchResolvedTypes(visitor, 'Foo<int, String> x;', 'Foo', | 167 matchResolvedTypes(visitor, 'Foo<int, String> x;', 'Foo', [ |
| 168 [compiler.coreClasses.intClass, compiler.coreClasses.stringClass]); | 168 compiler.commonElements.intClass, |
| 169 compiler.commonElements.stringClass |
| 170 ]); |
| 169 matchResolvedTypes(visitor, 'Foo<Foo, Foo> x;', 'Foo', [foo, foo]); | 171 matchResolvedTypes(visitor, 'Foo<Foo, Foo> x;', 'Foo', [foo, foo]); |
| 170 }), | 172 }), |
| 171 MockCompiler.create((MockCompiler compiler) { | 173 MockCompiler.create((MockCompiler compiler) { |
| 172 compiler.parseScript('class Foo<T, U> {}'); | 174 compiler.parseScript('class Foo<T, U> {}'); |
| 173 compiler.resolveStatement('Foo<notype, int> x;'); | 175 compiler.resolveStatement('Foo<notype, int> x;'); |
| 174 DiagnosticCollector collector = compiler.diagnosticCollector; | 176 DiagnosticCollector collector = compiler.diagnosticCollector; |
| 175 Expect.equals(1, collector.warnings.length); | 177 Expect.equals(1, collector.warnings.length); |
| 176 Expect.equals(MessageKind.CANNOT_RESOLVE_TYPE, | 178 Expect.equals(MessageKind.CANNOT_RESOLVE_TYPE, |
| 177 collector.warnings.first.message.kind); | 179 collector.warnings.first.message.kind); |
| 178 Expect.equals(0, collector.errors.length); | 180 Expect.equals(0, collector.errors.length); |
| (...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1534 functionName: 'm'); | 1536 functionName: 'm'); |
| 1535 check( | 1537 check( |
| 1536 ''' | 1538 ''' |
| 1537 class A { | 1539 class A { |
| 1538 m() => () => await - 3; | 1540 m() => () => await - 3; |
| 1539 } | 1541 } |
| 1540 main() => new A().m(); | 1542 main() => new A().m(); |
| 1541 ''', | 1543 ''', |
| 1542 className: 'A'); | 1544 className: 'A'); |
| 1543 } | 1545 } |
| OLD | NEW |