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

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

Issue 11299009: Support type literals as compile-time constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/codegen.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
index 554e5271e35eb074d8de3acca6f66ae1f3f79769..7b8f7f0773a337cd324649f7cc2ccc943ed70fe1 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -2482,7 +2482,9 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
// [arguments.head].
js.PropertyAccess field =
new js.PropertyAccess.field(pop(), typeVariable.toString());
- js.Expression genericName = new js.LiteralString("'${arguments.head}'");
+ RuntimeTypeInformation rti = compiler.enqueuer.codegen.universe.rti;
+ String typeName = rti.buildStringRepresentation(arguments.head);
+ js.Expression genericName = new js.LiteralString("'$typeName'");
js.Binary eqTest = new js.Binary('===', field, genericName);
// Also test for 'undefined' in case the object does not have
// any type variable.

Powered by Google App Engine
This is Rietveld 408576698