| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // VMOptions=--enable_type_checks --enable_asserts | 4 // VMOptions=--enable_type_checks --enable_asserts |
| 5 // | 5 // |
| 6 // Dart test program testing type checks. | 6 // Dart test program testing type checks. |
| 7 | 7 |
| 8 class TypeTest { | 8 class TypeTest { |
| 9 static test() { | 9 static test() { |
| 10 int result = 0; | 10 int result = 0; |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 | 487 |
| 488 static testMain() { | 488 static testMain() { |
| 489 Expect.equals(1, test()); | 489 Expect.equals(1, test()); |
| 490 Expect.equals(1, testSideEffect()); | 490 Expect.equals(1, testSideEffect()); |
| 491 Expect.equals(1, testArgument()); | 491 Expect.equals(1, testArgument()); |
| 492 Expect.equals(1, testReturn()); | 492 Expect.equals(1, testReturn()); |
| 493 Expect.equals(1, testField()); | 493 Expect.equals(1, testField()); |
| 494 Expect.equals(1, testAnyFunction()); | 494 Expect.equals(1, testAnyFunction()); |
| 495 //Expect.equals(1, testVoidFunction()); - Function type checking issue | 495 //Expect.equals(1, testVoidFunction()); - Function type checking issue |
| 496 //Expect.equals(1, testFunctionNum()); - Function type checking issue | 496 //Expect.equals(1, testFunctionNum()); - Function type checking issue |
| 497 //Expect.equals(9, testBoolCheck()); - Boolean checking on conditions is
not done | 497 Expect.equals(9, testBoolCheck()); |
| 498 //Expect.equals(1, testFactory()); - Not doing a test on factories | 498 //Expect.equals(1, testFactory()); - Not doing a test on factories |
| 499 Expect.equals(8, testListAssigment()); | 499 Expect.equals(8, testListAssigment()); |
| 500 } | 500 } |
| 501 } | 501 } |
| 502 | 502 |
| 503 | 503 |
| 504 class C { | 504 class C { |
| 505 factory C() { | 505 factory C() { |
| 506 return 1; // Implicit result type is 'C', not int. | 506 return 1; // Implicit result type is 'C', not int. |
| 507 } | 507 } |
| 508 } | 508 } |
| 509 | 509 |
| 510 | 510 |
| 511 main() { | 511 main() { |
| 512 TypeTest.testMain(); | 512 TypeTest.testMain(); |
| 513 } | 513 } |
| OLD | NEW |