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

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

Issue 2650493002: dart2js-kernel: handle [TypeLiteral]s that are function types (Closed)
Patch Set: Created 3 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4d590675497a7155c9a80b04b9eccb11a7b21735..96ebf53572b75d391023167e86ad78d25799829a 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -1774,22 +1774,20 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
stack.add(graph.addConstant(constant, closedWorld));
return;
}
- if (type is ir.TypeParameterType) {
- // TODO(sra): Convert the type logic here to use ir.DartType.
- ResolutionDartType dartType = astAdapter.getDartType(type);
- dartType = localsHandler.substInContext(dartType);
- HInstruction value = typeBuilder.analyzeTypeArgument(
- dartType, sourceElement,
- sourceInformation: null);
- _pushStaticInvocation(astAdapter.runtimeTypeToString,
- <HInstruction>[value], commonMasks.stringType);
- _pushStaticInvocation(astAdapter.createRuntimeType, <HInstruction>[pop()],
- astAdapter.createRuntimeTypeReturnType);
- return;
- }
- // TODO(27394): Function types observed. Where are they from?
- defaultExpression(typeLiteral);
- return;
+ // For other types (e.g. TypeParameterType, function types from expanded
+ // typedefs), look-up or construct a reified type representation and convert
+ // to a RuntimeType.
+
+ // TODO(sra): Convert the type logic here to use ir.DartType.
+ ResolutionDartType dartType = astAdapter.getDartType(type);
+ dartType = localsHandler.substInContext(dartType);
+ HInstruction value = typeBuilder.analyzeTypeArgument(
+ dartType, sourceElement,
+ sourceInformation: null);
+ _pushStaticInvocation(astAdapter.runtimeTypeToString,
+ <HInstruction>[value], commonMasks.stringType);
+ _pushStaticInvocation(astAdapter.createRuntimeType, <HInstruction>[pop()],
+ astAdapter.createRuntimeTypeReturnType);
}
@override
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698