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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 }), | 191 }), |
192 | 192 |
193 MockCompiler.create((MockCompiler compiler) { | 193 MockCompiler.create((MockCompiler compiler) { |
194 compiler.parseScript('class Foo<T> {' | 194 compiler.parseScript('class Foo<T> {' |
195 ' Foo<T> t;' | 195 ' Foo<T> t;' |
196 ' foo(Foo<T> f) {}' | 196 ' foo(Foo<T> f) {}' |
197 ' bar() { g(Foo<T> f) {}; g(); }' | 197 ' bar() { g(Foo<T> f) {}; g(); }' |
198 '}'); | 198 '}'); |
199 ClassElement foo = compiler.mainApp.find('Foo'); | 199 ClassElement foo = compiler.mainApp.find('Foo'); |
200 foo.ensureResolved(compiler.resolution); | 200 foo.ensureResolved(compiler.resolution); |
201 foo.lookupLocalMember('t').computeType(compiler.resolution); | 201 MemberElement tMember = foo.lookupLocalMember('t'); |
202 foo.lookupLocalMember('foo').computeType(compiler.resolution); | 202 tMember.computeType(compiler.resolution); |
| 203 MemberElement fooMember = foo.lookupLocalMember('foo'); |
| 204 fooMember.computeType(compiler.resolution); |
203 compiler.resolver.resolve(foo.lookupLocalMember('bar')); | 205 compiler.resolver.resolve(foo.lookupLocalMember('bar')); |
204 DiagnosticCollector collector = compiler.diagnosticCollector; | 206 DiagnosticCollector collector = compiler.diagnosticCollector; |
205 Expect.equals(0, collector.warnings.length); | 207 Expect.equals(0, collector.warnings.length); |
206 Expect.equals(0, collector.errors.length); | 208 Expect.equals(0, collector.errors.length); |
207 }), | 209 }), |
208 ]); | 210 ]); |
209 } | 211 } |
210 | 212 |
211 Future testSuperCalls() { | 213 Future testSuperCalls() { |
212 return MockCompiler.create((MockCompiler compiler) { | 214 return MockCompiler.create((MockCompiler compiler) { |
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 } | 1441 } |
1440 main() => A.m(); | 1442 main() => A.m(); |
1441 ''', functionName: 'm'); | 1443 ''', functionName: 'm'); |
1442 check(''' | 1444 check(''' |
1443 class A { | 1445 class A { |
1444 m() => () => await - 3; | 1446 m() => () => await - 3; |
1445 } | 1447 } |
1446 main() => new A().m(); | 1448 main() => new A().m(); |
1447 ''', className: 'A'); | 1449 ''', className: 'A'); |
1448 } | 1450 } |
OLD | NEW |