Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: pkg/compiler/lib/src/closure.dart

Issue 1158693003: dart2js cps: Change how type variables are accessed in constructors. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase + status file Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1b59ee36689b20d639e2ea3c9478ad53e7807b94 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,17 @@ 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);
+ }
+ node.block.accept(this);
+ }
+
visitAsyncForIn(AsyncForIn node) {
// An `await for` loop is enclosed in an implicit try-finally.
bool oldInTryStatement = inTryStatement;
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698