| 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:uri'; | 5 import 'dart:uri'; |
| 6 | 6 |
| 7 import "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart" | 7 import "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart" |
| 8 hide TreeElementMapping, TreeElements, SourceString; | 8 hide TreeElementMapping, TreeElements, SourceString; |
| 9 import "../../../sdk/lib/_internal/compiler/implementation/resolution/resolution
.dart"; | 9 import "../../../sdk/lib/_internal/compiler/implementation/resolution/resolution
.dart"; |
| 10 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t"; | 10 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t"; |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 class B extends A {} | 597 class B extends A {} |
| 598 main() { return new A(); }"""); | 598 main() { return new A(); }"""); |
| 599 FunctionElement mainElement = compiler.mainApp.find(MAIN); | 599 FunctionElement mainElement = compiler.mainApp.find(MAIN); |
| 600 compiler.resolver.resolve(mainElement); | 600 compiler.resolver.resolve(mainElement); |
| 601 Expect.equals(0, compiler.warnings.length); | 601 Expect.equals(0, compiler.warnings.length); |
| 602 Expect.equals(1, compiler.errors.length); | 602 Expect.equals(1, compiler.errors.length); |
| 603 Expect.equals(MessageKind.CYCLIC_CLASS_HIERARCHY, | 603 Expect.equals(MessageKind.CYCLIC_CLASS_HIERARCHY, |
| 604 compiler.errors[0].message.kind); | 604 compiler.errors[0].message.kind); |
| 605 | 605 |
| 606 compiler = new MockCompiler(); | 606 compiler = new MockCompiler(); |
| 607 compiler.parseScript("""interface A extends B {} | 607 compiler.parseScript("""abstract class A extends B {} |
| 608 interface B extends A {} | 608 abstract class B extends A {} |
| 609 class C implements A {} | 609 class C implements A {} |
| 610 main() { return new C(); }"""); | 610 main() { return new C(); }"""); |
| 611 mainElement = compiler.mainApp.find(MAIN); | 611 mainElement = compiler.mainApp.find(MAIN); |
| 612 compiler.resolver.resolve(mainElement); | 612 compiler.resolver.resolve(mainElement); |
| 613 Expect.equals(0, compiler.warnings.length); | 613 Expect.equals(0, compiler.warnings.length); |
| 614 Expect.equals(1, compiler.errors.length); | 614 Expect.equals(1, compiler.errors.length); |
| 615 Expect.equals(MessageKind.CYCLIC_CLASS_HIERARCHY, | 615 Expect.equals(MessageKind.CYCLIC_CLASS_HIERARCHY, |
| 616 compiler.errors[0].message.kind); | 616 compiler.errors[0].message.kind); |
| 617 | 617 |
| 618 compiler = new MockCompiler(); | 618 compiler = new MockCompiler(); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 var d = new D(); | 807 var d = new D(); |
| 808 --d; | 808 --d; |
| 809 }"""; | 809 }"""; |
| 810 final compiler = compileScript(script); | 810 final compiler = compileScript(script); |
| 811 | 811 |
| 812 checkMemberResolved(compiler, 'A', operatorName('+', false)); | 812 checkMemberResolved(compiler, 'A', operatorName('+', false)); |
| 813 checkMemberResolved(compiler, 'B', operatorName('+', false)); | 813 checkMemberResolved(compiler, 'B', operatorName('+', false)); |
| 814 checkMemberResolved(compiler, 'C', operatorName('-', false)); | 814 checkMemberResolved(compiler, 'C', operatorName('-', false)); |
| 815 checkMemberResolved(compiler, 'D', operatorName('-', false)); | 815 checkMemberResolved(compiler, 'D', operatorName('-', false)); |
| 816 } | 816 } |
| OLD | NEW |