Chromium Code Reviews| 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 |
|
ngeoffray
2013/06/18 08:00:43
which object? The real "this" object?
karlklose
2013/06/18 11:05:00
Yes.
|
| + // using the this-reference in the closure. |
| + return readTypeVariable(member.getEnclosingClass(), |
|
ngeoffray
2013/06/18 08:00:43
I would move this code in a if (isClosure) test li
karlklose
2013/06/18 11:05:00
Done.
|
| + type.element); |
|
ngeoffray
2013/06/18 08:00:43
Fits in one line?
karlklose
2013/06/18 11:05:00
Done.
|
| + } 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(), |