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

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

Issue 15563003: Add the cast equivalent of assertSubtype and assertSubtypeOfRuntimeType. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | tests/language/issue10747_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (revision 22932)
+++ sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (working copy)
@@ -1083,6 +1083,15 @@
HInstruction convertType(Compiler compiler, DartType type, int kind) {
if (type == null) return this;
+ // Only the builder knows how to create [HTypeConversion]
+ // instructions with generics. It has the generic type context
+ // available.
+ assert(type.kind != TypeKind.TYPE_VARIABLE);
+ // TODO(5022): Generic typedefs should not be handled here.
+ assert(type.isRaw
+ || type.isMalformed
+ || type.kind == TypeKind.TYPEDEF
+ || type.kind == TypeKind.FUNCTION);
if (identical(type.element, compiler.dynamicClass)) return this;
if (identical(type.element, compiler.objectClass)) return this;
if (type.isMalformed || type.kind != TypeKind.INTERFACE) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | tests/language/issue10747_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698