Index: pkg/compiler/lib/src/universe/resolution_world_builder.dart |
diff --git a/pkg/compiler/lib/src/universe/resolution_world_builder.dart b/pkg/compiler/lib/src/universe/resolution_world_builder.dart |
index cd2593ed383f7d8bd73dd1d639fa60d515e54818..ff1057bc522af1974fabe17ec02f9f2621c907d6 100644 |
--- a/pkg/compiler/lib/src/universe/resolution_world_builder.dart |
+++ b/pkg/compiler/lib/src/universe/resolution_world_builder.dart |
@@ -565,6 +565,17 @@ abstract class ResolutionWorldBuilderBase |
} |
void registerStaticUse(StaticUse staticUse, MemberUsedCallback memberUsed) { |
+ if (staticUse.kind == StaticUseKind.CLOSURE) { |
+ Local localFunction = staticUse.element; |
+ FunctionType type = |
+ _elementEnvironment.getLocalFunctionType(localFunction); |
+ if (type.containsTypeVariables) { |
+ localFunctionsWithFreeTypeVariables.add(localFunction); |
+ } |
+ localFunctions.add(staticUse.element); |
+ return; |
+ } |
+ |
MemberEntity element = staticUse.element; |
_StaticMemberUsage usage = _staticMemberUsage.putIfAbsent(element, () { |
if ((element.isStatic || element.isTopLevel) && element.isFunction) { |
@@ -589,8 +600,8 @@ abstract class ResolutionWorldBuilderBase |
fieldSetters.add(staticUse.element); |
break; |
case StaticUseKind.CLOSURE: |
- throw new UnimplementedError( |
- "registerStaticUse not implemented for StaticUseKind.CLOSURE."); |
+ // Already handled above. |
+ break; |
case StaticUseKind.SUPER_TEAR_OFF: |
useSet.addAll(usage.tearOff()); |
methodsNeedingSuperGetter.add(staticUse.element); |