| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 'package:expect/expect.dart'; | 6 import 'package:expect/expect.dart'; |
| 7 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
| 8 import 'compiler_helper.dart'; | 8 import 'compiler_helper.dart'; |
| 9 | 9 |
| 10 Future dummyImplTest() async { | 10 Future dummyImplTest() async { |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 Expect.isTrue(compiler.backend.enabledNoSuchMethod); | 264 Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
| 265 ClassElement clsA = findElement(compiler, 'A'); | 265 ClassElement clsA = findElement(compiler, 'A'); |
| 266 Expect.isTrue( | 266 Expect.isTrue( |
| 267 compiler.backend.noSuchMethodRegistry.otherImpls.contains( | 267 compiler.backend.noSuchMethodRegistry.otherImpls.contains( |
| 268 clsA.lookupMember('noSuchMethod'))); | 268 clsA.lookupMember('noSuchMethod'))); |
| 269 Expect.isTrue( | 269 Expect.isTrue( |
| 270 compiler.backend.noSuchMethodRegistry.complexReturningImpls.contains( | 270 compiler.backend.noSuchMethodRegistry.complexReturningImpls.contains( |
| 271 clsA.lookupMember('noSuchMethod'))); | 271 clsA.lookupMember('noSuchMethod'))); |
| 272 } | 272 } |
| 273 | 273 |
| 274 Future dummyImplTest13() async { |
| 275 String source = """ |
| 276 class A { |
| 277 noSuchMethod(x) => super.noSuchMethod(x) as dynamic; |
| 278 } |
| 279 main() { |
| 280 print(new A().foo()); |
| 281 } |
| 282 """; |
| 283 Uri uri = new Uri(scheme: 'source'); |
| 284 var compiler = compilerFor(source, uri); |
| 285 await compiler.run(uri); |
| 286 Expect.isFalse(compiler.backend.enabledNoSuchMethod); |
| 287 ClassElement clsA = findElement(compiler, 'A'); |
| 288 Expect.isTrue( |
| 289 compiler.backend.noSuchMethodRegistry.defaultImpls.contains( |
| 290 clsA.lookupMember('noSuchMethod'))); |
| 291 } |
| 292 |
| 274 main() { | 293 main() { |
| 275 asyncTest(() async { | 294 asyncTest(() async { |
| 276 await dummyImplTest(); | 295 await dummyImplTest(); |
| 277 await dummyImplTest2(); | 296 await dummyImplTest2(); |
| 278 await dummyImplTest3(); | 297 await dummyImplTest3(); |
| 279 await dummyImplTest4(); | 298 await dummyImplTest4(); |
| 280 await dummyImplTest5(); | 299 await dummyImplTest5(); |
| 281 await dummyImplTest6(); | 300 await dummyImplTest6(); |
| 282 await dummyImplTest7(); | 301 await dummyImplTest7(); |
| 283 await dummyImplTest8(); | 302 await dummyImplTest8(); |
| 284 await dummyImplTest9(); | 303 await dummyImplTest9(); |
| 285 await dummyImplTest10(); | 304 await dummyImplTest10(); |
| 286 await dummyImplTest11(); | 305 await dummyImplTest11(); |
| 287 await dummyImplTest12(); | 306 await dummyImplTest12(); |
| 307 await dummyImplTest13(); |
| 288 }); | 308 }); |
| 289 } | 309 } |
| OLD | NEW |