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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 12334070: Support runtime check of function types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Handle function types in checked mode. Created 7 years, 6 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: sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index d409045cbbd6573f9484277c0e0b3745b1a6fc73..0d1682bfc19ac70e5546a51d61755819ad1b8e64 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -1898,6 +1898,12 @@ class ResolverVisitor extends MappingVisitor<Element> {
}
parameterNodes = parameterNodes.tail;
});
+ if (inCheckContext) {
+ functionParameters.forEachParameter((Element element) {
+ compiler.enqueuer.resolution.registerIsCheck(
+ element.computeType(compiler), mapping);
+ });
+ }
}
visitCascade(Cascade node) {
@@ -1995,6 +2001,9 @@ class ResolverVisitor extends MappingVisitor<Element> {
scope = oldScope;
enclosingElement = previousEnclosingElement;
+ if (function.computeType(compiler).containsTypeVariables) {
+ world.registerGenericClosure(function, mapping);
+ }
world.registerInstantiatedClass(compiler.functionClass, mapping);
}

Powered by Google App Engine
This is Rietveld 408576698