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

Unified Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2996723002: Support typedef type literals (Closed)
Patch Set: Cleanup Created 3 years, 4 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
Index: pkg/compiler/lib/src/ssa/builder_kernel.dart
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index 16960d242d0183c6b272ef21d6d838a20a164319..527e7d66ba4852fc08f2825fc73f0e5e1357de06 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -2124,11 +2124,18 @@ class KernelSsaGraphBuilder extends ir.Visitor
@override
void visitTypeLiteral(ir.TypeLiteral typeLiteral) {
ir.DartType type = typeLiteral.type;
- if (type is ir.InterfaceType || type is ir.DynamicType) {
+ if (type is ir.InterfaceType ||
+ type is ir.DynamicType ||
+ type is ir.TypedefType ||
+ type is ir.FunctionType) {
ConstantValue constant = _elementMap.getConstantValue(typeLiteral);
stack.add(graph.addConstant(constant, closedWorld));
return;
}
+ assert(
+ type is ir.TypeParameterType,
+ failedAt(CURRENT_ELEMENT_SPANNABLE,
+ "Unexpected type literal ${typeLiteral}."));
// For other types (e.g. TypeParameterType, function types from expanded
// typedefs), look-up or construct a reified type representation and convert
// to a RuntimeType.

Powered by Google App Engine
This is Rietveld 408576698