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 | 4 |
5 #import("../../../lib/compiler/implementation/leg.dart"); | 5 #import("../../../lib/compiler/implementation/leg.dart"); |
6 #import("../../../lib/compiler/implementation/elements/elements.dart"); | 6 #import("../../../lib/compiler/implementation/elements/elements.dart"); |
7 #import("../../../lib/compiler/implementation/tree/tree.dart"); | 7 #import("../../../lib/compiler/implementation/tree/tree.dart"); |
8 #import('../../../lib/compiler/implementation/scanner/scannerlib.dart'); | 8 #import('../../../lib/compiler/implementation/scanner/scannerlib.dart'); |
9 #import("../../../lib/compiler/implementation/util/util.dart"); | 9 #import("../../../lib/compiler/implementation/util/util.dart"); |
10 #import("mock_compiler.dart"); | 10 #import("mock_compiler.dart"); |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 Expect.isTrue(isSubtype([], intType, [], intType)); | 361 Expect.isTrue(isSubtype([], intType, [], intType)); |
362 Expect.isTrue(isSubtype([], intType, [], objectType)); | 362 Expect.isTrue(isSubtype([], intType, [], objectType)); |
363 Expect.isFalse(isSubtype([], intType, [], doubleType)); | 363 Expect.isFalse(isSubtype([], intType, [], doubleType)); |
364 Expect.isTrue(isSubtype([intType], intType, [intType], intType)); | 364 Expect.isTrue(isSubtype([intType], intType, [intType], intType)); |
365 Expect.isTrue(isSubtype([objectType], intType, [intType], objectType)); | 365 Expect.isTrue(isSubtype([objectType], intType, [intType], objectType)); |
366 Expect.isFalse(isSubtype([intType], intType, [doubleType], intType)); | 366 Expect.isFalse(isSubtype([intType], intType, [doubleType], intType)); |
367 Expect.isFalse(isSubtype([intType], intType, [intType, intType], intType)); | 367 Expect.isFalse(isSubtype([intType], intType, [intType, intType], intType)); |
368 Expect.isFalse(isSubtype([intType, intType], intType, [intType], intType)); | 368 Expect.isFalse(isSubtype([intType, intType], intType, [intType], intType)); |
369 } | 369 } |
370 | 370 |
371 final CLASS_WITH_METHODS = ''' | 371 const CLASS_WITH_METHODS = ''' |
372 class ClassWithMethods { | 372 class ClassWithMethods { |
373 untypedNoArgumentMethod() {} | 373 untypedNoArgumentMethod() {} |
374 untypedOneArgumentMethod(argument) {} | 374 untypedOneArgumentMethod(argument) {} |
375 untypedTwoArgumentMethod(argument1, argument2) {} | 375 untypedTwoArgumentMethod(argument1, argument2) {} |
376 | 376 |
377 int intNoArgumentMethod() {} | 377 int intNoArgumentMethod() {} |
378 int intOneArgumentMethod(int argument) {} | 378 int intOneArgumentMethod(int argument) {} |
379 int intTwoArgumentMethod(int argument1, int argument2) {} | 379 int intTwoArgumentMethod(int argument1, int argument2) {} |
380 | 380 |
381 Function functionField; | 381 Function functionField; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 Node node = listener.popNode(); | 465 Node node = listener.popNode(); |
466 classElement.ensureResolved(compiler); | 466 classElement.ensureResolved(compiler); |
467 TreeElements elements = compiler.resolveNodeStatement(node, classElement); | 467 TreeElements elements = compiler.resolveNodeStatement(node, classElement); |
468 TypeCheckerVisitor checker = new TypeCheckerVisitor(compiler, elements, | 468 TypeCheckerVisitor checker = new TypeCheckerVisitor(compiler, elements, |
469 types); | 469 types); |
470 compiler.clearWarnings(); | 470 compiler.clearWarnings(); |
471 checker.currentClass = classElement; | 471 checker.currentClass = classElement; |
472 checker.analyze(node); | 472 checker.analyze(node); |
473 compareWarningKinds(text, expectedWarnings, compiler.warnings); | 473 compareWarningKinds(text, expectedWarnings, compiler.warnings); |
474 } | 474 } |
OLD | NEW |