Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: lib/compiler/implementation/ssa/builder.dart

Issue 10829379: Add erroneous elements for function types and use them to allow unresolvable constructors to be han… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and rebase. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/ssa/builder.dart
diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart
index d17708dcb3f66c3eac09020e0717687681b23bd3..75c467c8b4bc3a18d800a06a7d356f7c93733d30 100644
--- a/lib/compiler/implementation/ssa/builder.dart
+++ b/lib/compiler/implementation/ssa/builder.dart
@@ -2417,7 +2417,13 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
}
visitNewExpression(NewExpression node) {
- if (node.isConst()) {
+ Element element = elements[node.send];
+ if (Element.isInvalid(element)) {
+ // TODO(karlklose): generate runtime error or noSuchMethodCall, depending
+ // on whether element is null or it is an erroneous element with a
+ // particular error message.
+ compiler.cancel('Unimplemented unresolved constructor call', node: node);
+ } else if (node.isConst()) {
// TODO(karlklose): add type representation
ConstantHandler handler = compiler.constantHandler;
Constant constant = handler.compileNodeWithDefinitions(node, elements);

Powered by Google App Engine
This is Rietveld 408576698