| Index: sdk/lib/_internal/compiler/implementation/world.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/world.dart b/sdk/lib/_internal/compiler/implementation/world.dart
|
| index 033c95ba404981cbe512c2a03a31ccb36240b2d5..2d5accdb4e2a3725ff9c143d4600e998a3fef19f 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/world.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/world.dart
|
| @@ -29,6 +29,9 @@ class World {
|
|
|
| final Set<Element> elementsThatCannotThrow = new Set<Element>();
|
|
|
| + final Set<Element> functionsThatMightBePassedToApply =
|
| + new Set<FunctionElement>();
|
| +
|
| Set<ClassElement> subclassesOf(ClassElement cls) {
|
| return _subclasses[cls.declaration];
|
| }
|
| @@ -278,4 +281,21 @@ class World {
|
| FunctionElement superConstructor) {
|
| elements.otherDependencies.add(superConstructor);
|
| }
|
| +
|
| + void registerMightBePassedToApply(Element element) {
|
| + functionsThatMightBePassedToApply.add(element);
|
| + }
|
| +
|
| + bool getMightBePassedToApply(Element element) {
|
| + // We have to check whether the element we look at was created after
|
| + // type inference ran. This is currently only the case for the call
|
| + // method of function classes that were generated for function
|
| + // expressions. In such a case, we have to look at the original
|
| + // function expressions's element.
|
| + // TODO(herhut): Generate classes for function expressions earlier.
|
| + if (element is SynthesizedCallMethodElementX) {
|
| + return getMightBePassedToApply(element.expression);
|
| + }
|
| + return functionsThatMightBePassedToApply.contains(element);
|
| + }
|
| }
|
|
|