Skip to content

Commit f410498

Browse files
committed
Move CaptureSet to cc
1 parent 42c3676 commit f410498

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

compiler/src/dotty/tools/dotc/core/CaptureSet.scala renamed to compiler/src/dotty/tools/dotc/cc/CaptureSet.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
package dotty.tools
22
package dotc
3-
package core
3+
package cc
44

5+
import core.*
56
import Types.*, Symbols.*, Flags.*, Contexts.*, Decorators.*
67
import config.Printers.capt
78
import Annotations.Annotation
@@ -12,7 +13,6 @@ import printing.{Showable, Printer}
1213
import printing.Texts.*
1314
import util.SimpleIdentitySet
1415
import util.common.alwaysTrue
15-
import cc.*
1616

1717
/** A class for capture sets. Capture sets can be constants or variables.
1818
* Capture sets support inclusion constraints <:< where <:< is subcapturing.
@@ -179,7 +179,7 @@ object CaptureSet:
179179
defn.captureRoot.termRef.singletonCaptureSet
180180

181181
/** Used as a recursion brake */
182-
@sharable private[core] val Pending = Const(SimpleIdentitySet.empty)
182+
@sharable private[dotc] val Pending = Const(SimpleIdentitySet.empty)
183183

184184
def apply(elems: CaptureRef*)(using Context): CaptureSet.Const =
185185
if elems.isEmpty then empty

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import typer.ImportInfo.RootRef
1414
import Comments.CommentsContext
1515
import Comments.Comment
1616
import util.Spans.NoSpan
17-
import cc.CapturingType
17+
import cc.{CapturingType, CaptureSet}
1818

1919
import scala.annotation.tailrec
2020

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ import typer.ProtoTypes.constrained
2323
import typer.Applications.productSelectorTypes
2424
import reporting.trace
2525
import NullOpsDecorator._
26-
import CaptureSet.CompareResult as CaptCompareResult
2726
import annotation.constructorOnly
28-
import cc.{CapturingType, derivedCapturingType}
27+
import cc.{CapturingType, derivedCapturingType, CaptureSet}
2928

3029
/** Provides methods to compare types.
3130
*/
@@ -492,7 +491,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
492491
// under -Ycheck. Test case is i7965.scala.
493492

494493
case CapturingType(parent1, refs1) =>
495-
if refs1 <:< tp2.captureSet == CaptCompareResult.OK then recur(parent1, tp2)
494+
if refs1 <:< tp2.captureSet == CaptureSet.CompareResult.OK then recur(parent1, tp2)
496495
else thirdTry
497496
case tp1: AnnotatedType if !tp1.isRefining =>
498497
recur(tp1.parent, tp2)
@@ -2383,7 +2382,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
23832382
case tp1: TypeVar if tp1.isInstantiated =>
23842383
tp1.underlying & tp2
23852384
case CapturingType(parent1, refs1) =>
2386-
if tp2.captureSet <:< refs1 == CaptCompareResult.OK then parent1 & tp2
2385+
if tp2.captureSet <:< refs1 == CaptureSet.CompareResult.OK then parent1 & tp2
23872386
else tp1.derivedCapturingType(parent1 & tp2, refs1)
23882387
case tp1: AnnotatedType if !tp1.isRefining =>
23892388
tp1.underlying & tp2

compiler/src/dotty/tools/dotc/core/TypeOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import typer.ForceDegree
1919
import typer.Inferencing._
2020
import typer.IfBottom
2121
import reporting.TestingReporter
22+
import cc.{CapturingType, derivedCapturingType, CaptureSet}
2223
import CaptureSet.CompareResult
23-
import cc.{CapturingType, derivedCapturingType}
2424

2525
import scala.annotation.internal.sharable
2626
import scala.annotation.threadUnsafe

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import scala.util.hashing.{ MurmurHash3 => hashing }
3838
import config.Printers.{core, typr, matchTypes}
3939
import reporting.{trace, Message}
4040
import java.lang.ref.WeakReference
41-
import cc.{CapturingType, derivedCapturingType, retainedElems}
41+
import cc.{CapturingType, CaptureSet, derivedCapturingType, retainedElems}
4242
import CaptureSet.CompareResult
4343

4444
import scala.annotation.internal.sharable

compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import ProtoTypes._
1515
import collection.mutable
1616
import reporting._
1717
import Checking.{checkNoPrivateLeaks, checkNoWildcard}
18+
import cc.CaptureSet
1819

1920
trait TypeAssigner {
2021
import tpd.*

0 commit comments

Comments
 (0)