Skip to content

Commit c091c33

Browse files
committed
Move some cc classes to their proper place in the file hierarchy
1 parent 30a53ef commit c091c33

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package dotty.tools
2+
package dotc
3+
package cc
4+
5+
import core.*
6+
import Types.*, Symbols.*, Contexts.*
7+
8+
/** A one-element cache for the boxed version of an unboxed capturing type */
9+
class BoxedTypeCache:
10+
private var boxed: Type = compiletime.uninitialized
11+
private var unboxed: Type = NoType
12+
13+
def apply(tp: AnnotatedType)(using Context): Type =
14+
if tp ne unboxed then
15+
unboxed = tp
16+
val CapturingType(parent, refs) = tp: @unchecked
17+
boxed = CapturingType(parent, refs, boxed = true)
18+
boxed
19+
end BoxedTypeCache

0 commit comments

Comments
 (0)