| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
| 6 import | 6 import |
| 7 '../../../sdk/lib/_internal/compiler/implementation/types/types.dart' | 7 '../../../sdk/lib/_internal/compiler/implementation/types/types.dart' |
| 8 show TypeMask; | 8 show TypeMask; |
| 9 | 9 |
| 10 import 'compiler_helper.dart'; | 10 import 'compiler_helper.dart'; |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 returnInt3() => ++new A()[0]; | 379 returnInt3() => ++new A()[0]; |
| 380 returnInt4() => new A()[0] += 42; | 380 returnInt4() => new A()[0] += 42; |
| 381 returnInt5() => ++super.myField; | 381 returnInt5() => ++super.myField; |
| 382 returnInt6() => super.myField += 4; | 382 returnInt6() => super.myField += 4; |
| 383 returnInt7() => ++super[0]; | 383 returnInt7() => ++super[0]; |
| 384 returnInt8() => super[0] += 54; | 384 returnInt8() => super[0] += 54; |
| 385 returnInt9() => super.myField; | 385 returnInt9() => super.myField; |
| 386 } | 386 } |
| 387 | 387 |
| 388 main() { | 388 main() { |
| 389 // Ensure a function class is being instantiated. |
| 390 () => 42; |
| 389 returnNum1(true); | 391 returnNum1(true); |
| 390 returnNum2(true); | 392 returnNum2(true); |
| 391 returnInt1(true); | 393 returnInt1(true); |
| 392 returnInt2(true); | 394 returnInt2(true); |
| 393 returnInt3(true); | 395 returnInt3(true); |
| 394 returnInt4(); | 396 returnInt4(); |
| 395 returnDouble(true); | 397 returnDouble(true); |
| 396 returnGiveUp(true); | 398 returnGiveUp(true); |
| 397 returnInt5(); | 399 returnInt5(); |
| 398 returnInt6(); | 400 returnInt6(); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 checkReturnInClass('B', 'returnInt9', typesInferrer.intType); | 554 checkReturnInClass('B', 'returnInt9', typesInferrer.intType); |
| 553 | 555 |
| 554 checkFactoryConstructor(String className) { | 556 checkFactoryConstructor(String className) { |
| 555 var cls = findElement(compiler, className); | 557 var cls = findElement(compiler, className); |
| 556 var element = cls.localLookup(buildSourceString(className)); | 558 var element = cls.localLookup(buildSourceString(className)); |
| 557 Expect.equals(new TypeMask.nonNullExact(cls.rawType), | 559 Expect.equals(new TypeMask.nonNullExact(cls.rawType), |
| 558 typesInferrer.internal.returnTypeOf[element]); | 560 typesInferrer.internal.returnTypeOf[element]); |
| 559 } | 561 } |
| 560 checkFactoryConstructor('A'); | 562 checkFactoryConstructor('A'); |
| 561 } | 563 } |
| OLD | NEW |