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

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: Address comments. 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 3eba765941b136686c2c788bd4cd580628147f46..898a54c865defa32688952085222607adac24cd3 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -2485,7 +2485,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 = backend.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