Move the final transpilation passes to the end of the checks phase.
@@ -495,19 +495,6 @@ public final class DefaultPassConfig extends PassConfig {
}
}
- if (options.needsTranspilationFrom(ES6) && !options.getNewTypeInference()) {
- // Note that TranspilationPasses.addEs6PostTypecheckPasses is really only "post typecheck"
- // for OTI. The code path for NTI includes an earlier call to addEs6PostTypecheckPasses.
- TranspilationPasses.addEs6PostTypecheckPasses(checks);
- }
-
- if (options.needsTranspilationFrom(ES6) && !options.checksOnly) {
- // At this point all checks have been done.
- // There's no need to complete transpilation if we're only running checks.
- TranspilationPasses.addEs6PostCheckPasses(checks);
- }
-
-
// NOTE(dimvar): Tried to move this into the optimizations, but had to back off
// because the very first pass, normalization, rewrites the code in a way that
// causes loss of type information.
@@ -529,6 +516,19 @@ public final class DefaultPassConfig extends PassConfig {
checks.add(createEmptyPass(PassNames.AFTER_STANDARD_CHECKS));
+ if (options.needsTranspilationFrom(ES6) && !options.getNewTypeInference()) {
+ // Note that TranspilationPasses.addEs6PostTypecheckPasses is really only "post typecheck"
+ // for OTI. The code path for NTI includes an earlier call to addEs6PostTypecheckPasses.
+ TranspilationPasses.addEs6PostTypecheckPasses(checks);
+ }
+
+ if (options.needsTranspilationFrom(ES6) && !options.checksOnly) {
+ // At this point all checks have been done.
+ // There's no need to complete transpilation if we're only running checks.
+ TranspilationPasses.addEs6PostCheckPasses(checks);
+ }
+
+
assertAllOneTimePasses(checks);
assertValidOrderForChecks(checks);
