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

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

Issue 11416144: Produce run-time error when type parameters are accessed from static context. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed redundant malformed type replacement with dynamic type. Created 8 years, 1 month 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: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index 718a8cb57c210f89b9bfb551087f08c55ee4dc5e..39863f74331884e6be69d3f5be3c8853450c643f 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -3443,7 +3443,8 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
visitNewExpression(NewExpression node) {
Element element = elements[node.send];
- if (!Elements.isErroneousElement(element)) {
+ if (!Elements.isErroneousElement(element) &&
+ !Elements.isMalformedElement(element)) {
ngeoffray 2012/11/27 09:37:35 !Elements.isUnresolved ?
aam-me 2012/11/28 01:49:47 Yes, agree. Good idea.
FunctionElement function = element;
element = function.redirectionTarget;
}
@@ -3465,6 +3466,10 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
ConstantHandler handler = compiler.constantHandler;
Constant constant = handler.compileNodeWithDefinitions(node, elements);
stack.add(graph.addConstant(constant));
+ } else if (Elements.isMalformedElement(element)) {
+ Message message =
+ MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER.message([element]);
+ generateRuntimeError(node.send, message.toString());
} else {
visitNewSend(node.send, elements.getType(node));
}

Powered by Google App Engine
This is Rietveld 408576698