| Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
|
| index 75d644355eece6246ba3cb338c882e5e44d4f904..e1176aeadee91e90460be712c030e717275bb9bc 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
|
| @@ -3253,8 +3253,15 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
|
| } else if (member.isConstructor() ||
|
| member.isGenerativeConstructorBody() ||
|
| member.isField()) {
|
| - // The type variable is stored in a parameter of the method.
|
| - return localsHandler.readLocal(type.element);
|
| + if (isClosure && !member.isField()) {
|
| + // The type variable is stored on the object and needs to be accessed
|
| + // using the this-reference in the closure.
|
| + return readTypeVariable(member.getEnclosingClass(),
|
| + type.element);
|
| + } else {
|
| + // The type variable is stored in a parameter of the method.
|
| + return localsHandler.readLocal(type.element);
|
| + }
|
| } else if (member.isInstanceMember()) {
|
| // The type variable is stored on the object.
|
| return readTypeVariable(member.getEnclosingClass(),
|
|
|