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

Unified Diff: sdk/lib/_internal/compiler/implementation/closure.dart

Issue 32203002: Fix crash https://code.google.com/p/dart/issues/detail?id=14014: remove what seems to be obsolete c… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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
Index: sdk/lib/_internal/compiler/implementation/closure.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/closure.dart (revision 28922)
+++ sdk/lib/_internal/compiler/implementation/closure.dart (working copy)
@@ -770,19 +770,13 @@
}
DartType type = element.computeType(compiler);
- // Compute the function type and check for type variables in return or
- // parameter types.
- if (type.containsTypeVariables) {
- registerNeedsThis();
+ // If the method needs RTI, or checked mode is set, we need to
+ // escape the potential type variables used in that closure.
+ if (element is FunctionElement
+ && (compiler.backend.methodNeedsRti(element) ||
+ compiler.enableTypeAssertions)) {
+ analyzeTypeVariables(type);
}
- // Ensure that closure that need runtime type information has access to
- // this of the enclosing class.
- if (element is FunctionElement &&
- closureData.thisElement != null &&
- type.containsTypeVariables &&
- compiler.backend.methodNeedsRti(element)) {
- registerNeedsThis();
- }
visitChildren();
});

Powered by Google App Engine
This is Rietveld 408576698