| Index: pkg/compiler/lib/src/ssa/builder.dart
|
| diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
|
| index ea4d0808b9b4174c12d6b9be4c24020a20cf6d7a..bfeaefbea404b7cc6bcf952e555030df02324378 100644
|
| --- a/pkg/compiler/lib/src/ssa/builder.dart
|
| +++ b/pkg/compiler/lib/src/ssa/builder.dart
|
| @@ -2228,6 +2228,15 @@ class SsaBuilder extends ResolvedVisitor {
|
| }
|
| });
|
|
|
| + // If there are locals that escape (ie mutated in closures), we
|
| + // pass the box to the constructor.
|
| + // The box must be passed before any type variable.
|
| + ClosureScope scopeData = parameterClosureData.capturingScopes[node];
|
| + if (scopeData != null) {
|
| + bodyCallInputs.add(localsHandler.readLocal(scopeData.boxElement));
|
| + }
|
| +
|
| + // Type variables arguments must come after the box (if there is one).
|
| ClassElement currentClass = constructor.enclosingClass;
|
| if (backend.classNeedsRti(currentClass)) {
|
| // If [currentClass] needs RTI, we add the type variables as
|
| @@ -2240,13 +2249,6 @@ class SsaBuilder extends ResolvedVisitor {
|
| });
|
| }
|
|
|
| - // If there are locals that escape (ie mutated in closures), we
|
| - // pass the box to the constructor.
|
| - ClosureScope scopeData = parameterClosureData.capturingScopes[node];
|
| - if (scopeData != null) {
|
| - bodyCallInputs.add(localsHandler.readLocal(scopeData.boxElement));
|
| - }
|
| -
|
| if (!isNativeUpgradeFactory && // TODO(13836): Fix inlining.
|
| tryInlineMethod(body, null, bodyCallInputs, function)) {
|
| pop();
|
|
|