Chromium Code Reviews| Index: pkg/compiler/lib/src/closure.dart |
| diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart |
| index 355e52671e11c2de4f5bae6ae9ba1b2086376126..fcaa7ff771e9aa683b77b2c1ae9afdc4abbdad6f 100644 |
| --- a/pkg/compiler/lib/src/closure.dart |
| +++ b/pkg/compiler/lib/src/closure.dart |
| @@ -741,7 +741,8 @@ class ClosureTranslator extends Visitor { |
| } else { |
| Element element = elements[node]; |
| if (element != null && element.isTypeVariable) { |
| - if (outermostElement.isConstructor) { |
| + if (outermostElement.isConstructor || |
| + outermostElement.isField) { |
| TypeVariableElement typeVariable = element; |
| useTypeVariableAsLocal(typeVariable.type); |
| } else { |
| @@ -1081,6 +1082,15 @@ class ClosureTranslator extends Visitor { |
| inTryStatement = oldInTryStatement; |
| } |
| + visitCatchBlock(CatchBlock node) { |
| + if (node.type != null) { |
| + // The "on T" clause may contain type variables. |
| + analyzeType(elements.getType(node.type)); |
| + } |
| + if (node.formals != null) node.formals.visitChildren(this); |
|
karlklose
2015/05/28 08:12:19
Use {}.
asgerf
2015/05/28 09:34:21
Done.
|
| + node.block.accept(this); |
| + } |
| + |
| visitAsyncForIn(AsyncForIn node) { |
| // An `await for` loop is enclosed in an implicit try-finally. |
| bool oldInTryStatement = inTryStatement; |