Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart |
=================================================================== |
--- sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 22937) |
+++ sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy) |
@@ -376,7 +376,7 @@ |
Element redirect = redirectionMapping[element]; |
HInstruction receiver = readLocal(closureData.closureElement); |
HInstruction fieldGet = new HFieldGet(redirect, receiver); |
- fieldGet.instructionType = builder.getTypeOfCapturedVariable(element); |
+ fieldGet.instructionType = builder.getTypeOfCapturedVariable(redirect); |
builder.add(fieldGet); |
return fieldGet; |
} else if (isBoxed(element)) { |
@@ -389,7 +389,7 @@ |
assert(redirect.enclosingElement.isVariable()); |
HInstruction box = readLocal(redirect.enclosingElement); |
HInstruction lookup = new HFieldGet(redirect, box); |
- lookup.instructionType = builder.getTypeOfCapturedVariable(element); |
+ lookup.instructionType = builder.getTypeOfCapturedVariable(redirect); |
builder.add(lookup); |
return lookup; |
} else { |
@@ -1014,6 +1014,7 @@ |
new Map<Element, HType>(); |
HType getTypeOfCapturedVariable(Element element) { |
+ assert(element.isField()); |
return cachedTypesOfCapturedVariables.putIfAbsent(element, () { |
return new HType.inferredTypeForElement(element, compiler); |
}); |