| Index: lib/compiler/implementation/closure.dart
|
| ===================================================================
|
| --- lib/compiler/implementation/closure.dart (revision 12455)
|
| +++ lib/compiler/implementation/closure.dart (working copy)
|
| @@ -374,11 +374,13 @@
|
| }
|
| }
|
|
|
| - if (outermostFunctionElement.isInstanceMember()
|
| - || outermostFunctionElement.isGenerativeConstructor()) {
|
| - if (hasTypeVariable(type)) useLocal(closureData.thisElement);
|
| - } else if (outermostFunctionElement.isFactoryConstructor()) {
|
| - analyzeTypeVariables(type);
|
| + if (compiler.world.needsRti(outermostFunctionElement.enclosingElement)) {
|
| + if (outermostFunctionElement.isInstanceMember()
|
| + || outermostFunctionElement.isGenerativeConstructor()) {
|
| + if (hasTypeVariable(type)) useLocal(closureData.thisElement);
|
| + } else if (outermostFunctionElement.isFactoryConstructor()) {
|
| + analyzeTypeVariables(type);
|
| + }
|
| }
|
|
|
| node.visitChildren(this);
|
| @@ -547,7 +549,8 @@
|
| declareLocal(element);
|
| }
|
|
|
| - if (currentFunctionElement.isFactoryConstructor()) {
|
| + if (currentFunctionElement.isFactoryConstructor()
|
| + && compiler.world.needsRti(currentFunctionElement.enclosingElement)) {
|
| // Declare the type parameters in the scope. Generative
|
| // constructors just use 'this'.
|
| ClassElement cls = currentFunctionElement.enclosingElement;
|
|
|