Skip to content

Commit aada0bd

Browse files
committed
Move checkCaptures before pruneErasedDefs
pruneErasedDef's normalizations interfere with it.
1 parent 82046e7 commit aada0bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/Compiler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ class Compiler {
8484
new ExplicitSelf, // Make references to non-trivial self types explicit as casts
8585
new ElimByName, // Expand by-name parameter references
8686
new StringInterpolatorOpt) :: // Optimizes raw and s string interpolators by rewriting them to string concatenations
87+
List(new PreRecheck) ::
88+
List(new CheckCaptures) ::
8789
List(new PruneErasedDefs, // Drop erased definitions from scopes and simplify erased expressions
8890
new UninitializedDefs, // Replaces `compiletime.uninitialized` by `_`
8991
new InlinePatterns, // Remove placeholders of inlined patterns
@@ -101,8 +103,6 @@ class Compiler {
101103
new TupleOptimizations, // Optimize generic operations on tuples
102104
new LetOverApply, // Lift blocks from receivers of applications
103105
new ArrayConstructors) :: // Intercept creation of (non-generic) arrays and intrinsify.
104-
List(new PreRecheck) ::
105-
List(new CheckCaptures) ::
106106
List(new Erasure) :: // Rewrite types to JVM model, erasing all type parameters, abstract types and refinements.
107107
List(new ElimErasedValueType, // Expand erased value types to their underlying implmementation types
108108
new PureStats, // Remove pure stats from blocks

0 commit comments

Comments
 (0)