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

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: Fixed dart2dart unchcked tests. 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 4a9c498752df3d01e15494a13799f33f50f69a3d..1f588f671b44610f8e0702e05cba4079b8e1ce98 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -3489,7 +3489,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)) {
FunctionElement function = element;
element = function.redirectionTarget;
}
@@ -3511,6 +3512,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 = new ResolutionWarning(MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
ahe 2012/11/22 12:41:30 Long line.
ahe 2012/11/22 12:41:30 Alternatively: MessageKind.TYPE_VARIABLE_WITHIN_S
aam-me 2012/11/23 02:16:47 Done.
+ [element]);
+ generateRuntimeError(node.send, message.toString());
} else {
visitNewSend(node.send, elements.getType(node));
}

Powered by Google App Engine
This is Rietveld 408576698