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

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

Issue 10162004: Hack around issue with is checks against type variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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
« no previous file with comments | « no previous file | tests/co19/co19-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/builder.dart
diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart
index fe2c2c4f95210280ed54cf2a2de4078150ccd749..b64b24bc70e12e2dd56d6f4f3ecfb6d2f677a9eb 100644
--- a/lib/compiler/implementation/ssa/builder.dart
+++ b/lib/compiler/implementation/ssa/builder.dart
@@ -1778,12 +1778,20 @@ class SsaBuilder implements Visitor {
isNot = true;
}
Type type = elements.getType(typeAnnotation);
- HInstruction instruction = new HIs(type, expression);
- if (isNot) {
- add(instruction);
- instruction = new HNot(instruction);
+ if (type.element.kind === ElementKind.TYPE_VARIABLE) {
+ // TODO(karlklose): We emulate the frog behavior and answer
+ // true to any is check involving a type variable -- both is T
+ // and is !T -- until we have a proper implementation of
+ // reified generics.
+ stack.add(graph.addConstantBool(true));
floitsch 2012/04/20 12:04:34 maybe emit a warning?
+ } else {
+ HInstruction instruction = new HIs(type, expression);
+ if (isNot) {
+ add(instruction);
+ instruction = new HNot(instruction);
+ }
+ push(instruction);
}
- push(instruction);
} else {
visit(node.receiver);
visit(node.argumentsNode);
« no previous file with comments | « no previous file | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698