| 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 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 class TypeCheckerTask extends CompilerTask { | 7 class TypeCheckerTask extends CompilerTask { |
| 8 TypeCheckerTask(Compiler compiler) : super(compiler); | 8 TypeCheckerTask(Compiler compiler) : super(compiler); |
| 9 String get name => "Type checker"; | 9 String get name => "Type checker"; |
| 10 | 10 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 if (currentClass != null) { | 183 if (currentClass != null) { |
| 184 thisType = currentClass.computeType(compiler); | 184 thisType = currentClass.computeType(compiler); |
| 185 superType = currentClass.supertype; | 185 superType = currentClass.supertype; |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 | 188 |
| 189 LibraryElement get currentLibrary => elements.currentElement.getLibrary(); | 189 LibraryElement get currentLibrary => elements.currentElement.getLibrary(); |
| 190 | 190 |
| 191 reportTypeWarning(Node node, MessageKind kind, [Map arguments = const {}]) { | 191 reportTypeWarning(Node node, MessageKind kind, [Map arguments = const {}]) { |
| 192 compiler.reportWarning(node, new TypeWarning(kind, arguments)); | 192 compiler.reportWarning( |
| 193 node, new TypeWarning(kind, arguments, compiler.terseDiagnostics)); |
| 193 } | 194 } |
| 194 | 195 |
| 195 reportTypeInfo(Spannable node, MessageKind kind, [Map arguments = const {}]) { | 196 reportTypeInfo(Spannable node, MessageKind kind, [Map arguments = const {}]) { |
| 196 compiler.reportDiagnostic(compiler.spanFromSpannable(node), | 197 compiler.reportDiagnostic(compiler.spanFromSpannable(node), |
| 197 'Info: ${kind.message(arguments)}', api.Diagnostic.INFO); | 198 'Info: ${kind.message(arguments)}', api.Diagnostic.INFO); |
| 198 } | 199 } |
| 199 | 200 |
| 200 // TODO(karlklose): remove these functions. | 201 // TODO(karlklose): remove these functions. |
| 201 DartType unhandledStatement() => StatementType.NOT_RETURNING; | 202 DartType unhandledStatement() => StatementType.NOT_RETURNING; |
| 202 DartType unhandledExpression() => types.dynamicType; | 203 DartType unhandledExpression() => types.dynamicType; |
| (...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 visitTypedef(Typedef node) { | 1226 visitTypedef(Typedef node) { |
| 1226 // Do not typecheck [Typedef] nodes. | 1227 // Do not typecheck [Typedef] nodes. |
| 1227 } | 1228 } |
| 1228 | 1229 |
| 1229 visitNode(Node node) { | 1230 visitNode(Node node) { |
| 1230 compiler.internalError( | 1231 compiler.internalError( |
| 1231 'Unexpected node ${node.getObjectDescription()} in the type checker.', | 1232 'Unexpected node ${node.getObjectDescription()} in the type checker.', |
| 1232 node: node); | 1233 node: node); |
| 1233 } | 1234 } |
| 1234 } | 1235 } |
| OLD | NEW |