File tree Expand file tree Collapse file tree 4 files changed +25
-53
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 4 files changed +25
-53
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,6 @@ class Compiler {
87
87
new StringInterpolatorOpt ) :: // Optimizes raw and s string interpolators by rewriting them to string concatenations
88
88
List (new PreRecheck ) :: // Preparations for check captures phase, enabled under -Ycc
89
89
List (new CheckCaptures ) :: // Check captures, enabled under -Ycc
90
- List (new PostCapture ) :: // Reset denotations transformed by CheckCaptures back to annotated types
91
90
List (new PruneErasedDefs , // Drop erased definitions from scopes and simplify erased expressions
92
91
new UninitializedDefs , // Replaces `compiletime.uninitialized` by `_`
93
92
new InlinePatterns , // Remove placeholders of inlined patterns
Original file line number Diff line number Diff line change @@ -11,12 +11,11 @@ object CapturingType:
11
11
if refs.isAlwaysEmpty then parent
12
12
else AnnotatedType (parent, CaptureAnnotation (refs))
13
13
14
- def unapply (tp : AnnotatedType )(using Context ) = tp.annot match
15
- case ann : CaptureAnnotation =>
16
- Some ((tp.parent, ann.refs))
17
- case ann =>
18
- if ann.symbol == defn.RetainsAnnot && ctx.phase == Phases .checkCapturesPhase
19
- then Some ((tp.parent, ann.tree.toCaptureSet))
20
- else None
14
+ def unapply (tp : AnnotatedType )(using Context ) =
15
+ if ctx.phase == Phases .checkCapturesPhase && tp.annot.symbol == defn.RetainsAnnot then
16
+ tp.annot match
17
+ case ann : CaptureAnnotation => Some ((tp.parent, ann.refs))
18
+ case ann => Some ((tp.parent, ann.tree.toCaptureSet))
19
+ else None
21
20
22
21
end CapturingType
Original file line number Diff line number Diff line change
1
+ package dotty .tools .dotc
2
+ package transform
3
+
4
+ import core .*
5
+ import Contexts .Context
6
+ import Phases .Phase
7
+
8
+ /** A phase that can be inserted directly after a phase that cannot
9
+ * be checked, to enable a -Ycheck as soon as possible afterwards
10
+ */
11
+ class EmptyPhase extends Phase :
12
+
13
+ def phaseName : String = " dummy"
14
+
15
+ override def isEnabled (using Context ) = prev.isEnabled
16
+
17
+ override def run (using Context ) = ()
18
+
19
+ end EmptyPhase
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments