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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 arguments.printOn(sb, ', '); | 85 arguments.printOn(sb, ', '); |
86 sb.add('>'); | 86 sb.add('>'); |
87 } | 87 } |
88 return sb.toString(); | 88 return sb.toString(); |
89 } | 89 } |
90 } | 90 } |
91 | 91 |
92 class FunctionType implements Type { | 92 class FunctionType implements Type { |
93 final Element element; | 93 final Element element; |
94 final Type returnType; | 94 final Type returnType; |
95 final Link<Type> parameterTypes; | 95 Link<Type> parameterTypes; |
96 | 96 |
97 const FunctionType(Type this.returnType, Link<Type> this.parameterTypes, | 97 FunctionType(Type this.returnType, Link<Type> this.parameterTypes, |
98 Element this.element); | 98 Element this.element); |
99 | 99 |
100 toString() { | 100 toString() { |
101 StringBuffer sb = new StringBuffer(); | 101 StringBuffer sb = new StringBuffer(); |
102 bool first = true; | 102 bool first = true; |
103 sb.add('('); | 103 sb.add('('); |
104 parameterTypes.printOn(sb, ', '); | 104 parameterTypes.printOn(sb, ', '); |
105 sb.add(') -> ${returnType}'); | 105 sb.add(') -> ${returnType}'); |
106 return sb.toString(); | 106 return sb.toString(); |
107 } | 107 } |
108 | 108 |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 } | 772 } |
773 | 773 |
774 visitCatchBlock(CatchBlock node) { | 774 visitCatchBlock(CatchBlock node) { |
775 return unhandledStatement(); | 775 return unhandledStatement(); |
776 } | 776 } |
777 | 777 |
778 visitTypedef(Typedef node) { | 778 visitTypedef(Typedef node) { |
779 return unhandledStatement(); | 779 return unhandledStatement(); |
780 } | 780 } |
781 } | 781 } |
OLD | NEW |