Chromium Code Reviews| 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 class TypeCheckerTask extends CompilerTask { | 5 class TypeCheckerTask extends CompilerTask { |
| 6 TypeCheckerTask(Compiler compiler) : super(compiler); | 6 TypeCheckerTask(Compiler compiler) : super(compiler); |
| 7 String get name() => "Type checker"; | 7 String get name() => "Type checker"; |
| 8 | 8 |
| 9 static final bool LOG_FAILURES = false; | 9 static final bool LOG_FAILURES = false; |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 | 54 |
| 55 /** Combine the information about two control-flow edges that are joined. */ | 55 /** Combine the information about two control-flow edges that are joined. */ |
| 56 StatementType join(StatementType other) { | 56 StatementType join(StatementType other) { |
| 57 return (this === other) ? this : MAYBE_RETURNING; | 57 return (this === other) ? this : MAYBE_RETURNING; |
| 58 } | 58 } |
| 59 | 59 |
| 60 String toString() => stringName; | 60 String toString() => stringName; |
| 61 } | 61 } |
| 62 | 62 |
| 63 class InterfaceType implements Type { | 63 class InterfaceType implements Type { |
| 64 final SourceString name; | |
| 65 final Element element; | 64 final Element element; |
| 66 final Link<Type> arguments; | 65 final Link<Type> arguments; |
| 67 | 66 |
| 68 const InterfaceType(this.name, this.element, | 67 const InterfaceType(name, this.element, |
|
ahe
2012/05/01 17:26:24
I don't think you need the name argument.
karlklose
2012/05/02 08:26:50
Yes, removed.
| |
| 69 [this.arguments = const EmptyLink<Type>()]); | 68 [this.arguments = const EmptyLink<Type>()]); |
| 70 | 69 |
| 70 SourceString get name() => element.name; | |
| 71 | |
| 71 toString() { | 72 toString() { |
| 72 StringBuffer sb = new StringBuffer(); | 73 StringBuffer sb = new StringBuffer(); |
| 73 sb.add(name.slowToString()); | 74 sb.add(name.slowToString()); |
| 74 if (!arguments.isEmpty()) { | 75 if (!arguments.isEmpty()) { |
| 75 sb.add('<'); | 76 sb.add('<'); |
| 76 arguments.printOn(sb); | 77 arguments.printOn(sb, ', '); |
| 77 sb.add('>'); | 78 sb.add('>'); |
| 78 } | 79 } |
| 79 return sb.toString(); | 80 return sb.toString(); |
| 80 } | 81 } |
| 81 } | 82 } |
| 82 | 83 |
| 83 class FunctionType implements Type { | 84 class FunctionType implements Type { |
| 84 final Element element; | 85 final Element element; |
| 85 final Type returnType; | 86 final Type returnType; |
| 86 final Link<Type> parameterTypes; | 87 final Link<Type> parameterTypes; |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 727 } | 728 } |
| 728 | 729 |
| 729 visitCatchBlock(CatchBlock node) { | 730 visitCatchBlock(CatchBlock node) { |
| 730 fail(node); | 731 fail(node); |
| 731 } | 732 } |
| 732 | 733 |
| 733 visitTypedef(Typedef node) { | 734 visitTypedef(Typedef node) { |
| 734 fail(node); | 735 fail(node); |
| 735 } | 736 } |
| 736 } | 737 } |
| OLD | NEW |