Skip to content

Commit c1753fe

Browse files
committed
several fixes to CC compiler
1 parent 7e74341 commit c1753fe

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

tests/pos-with-compiler-cc/dotc/core/GadtConstraint.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ sealed trait GadtConstraint (
238238
private def tvarOrError(sym: Symbol)(using Context): TypeVar =
239239
mapping(sym).ensuring(_ != null, i"not a constrainable symbol: $sym").uncheckedNN
240240

241-
private def containsNoInternalTypes(tp: Type, theAcc: TypeAccumulator[Boolean] | Null = null)(using Context): Boolean = tp match {
241+
private def containsNoInternalTypes(tp: Type, theAcc: TypeAccumulator[Boolean] @retains(caps.*) | Null = null)(using Context): Boolean = tp match {
242242
case tpr: TypeParamRef => !reverseMapping.contains(tpr)
243243
case tv: TypeVar => !reverseMapping.contains(tv.origin)
244244
case tp =>

tests/pos-with-compiler-cc/dotc/core/Types.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ object Types {
115115
private def testProvisional(using Context): Boolean =
116116
class ProAcc extends TypeAccumulator[Boolean]:
117117
override def apply(x: Boolean, t: Type) = x || test(t, this)
118-
def test(t: Type, theAcc: TypeAccumulator[Boolean] | Null): Boolean =
118+
def test(t: Type, theAcc: TypeAccumulator[Boolean] @retains(caps.*) | Null): Boolean =
119119
if t.mightBeProvisional then
120120
t.mightBeProvisional = t match
121121
case t: TypeRef =>
@@ -3773,7 +3773,7 @@ object Types {
37733773
val status = (x & StatusMask) max (y & StatusMask)
37743774
val provisional = (x | y) & Provisional
37753775
(if status == TrueDeps then status else status | provisional).toByte
3776-
def compute(status: DependencyStatus, tp: Type, theAcc: TypeAccumulator[DependencyStatus] | Null): DependencyStatus =
3776+
def compute(status: DependencyStatus, tp: Type, theAcc: TypeAccumulator[DependencyStatus] @retains(caps.*) | Null): DependencyStatus =
37773777
def applyPrefix(tp: NamedType) =
37783778
if tp.isInstanceOf[SingletonType] && tp.currentSymbol.isStatic
37793779
then status // Note: a type ref with static symbol can still be dependent since the symbol might be refined in the enclosing type. See pos/15331.scala.
@@ -4351,7 +4351,7 @@ object Types {
43514351
private var myEvalRunId: RunId = NoRunId
43524352
private var myEvalued: Type = uninitialized
43534353

4354-
def isGround(acc: TypeAccumulator[Boolean])(using Context): Boolean =
4354+
def isGround(acc: TypeAccumulator[Boolean] @retains(caps.*))(using Context): Boolean =
43554355
if myGround == 0 then myGround = if acc.foldOver(true, this) then 1 else -1
43564356
myGround > 0
43574357

@@ -5750,7 +5750,7 @@ object Types {
57505750
}
57515751
}
57525752

5753-
private def treeTypeMap = new TreeTypeMap(typeMap = this)
5753+
private def treeTypeMap = new TreeTypeMap(typeMap = this.detach)
57545754

57555755
def mapOver(syms: List[Symbol]): List[Symbol] = mapSymbols(syms, treeTypeMap)
57565756

tests/pos-with-compiler-cc/dotc/transform/TreeMapWithStages.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import scala.annotation.constructorOnly
1818
* and `l == -1` is code inside a top level splice (in an inline method).
1919
* @param levels a stacked map from symbols to the levels in which they were defined
2020
*/
21-
abstract class TreeMapWithStages(@constructorOnly ictx: Context) extends TreeMapWithImplicits {
21+
abstract class TreeMapWithStages(@constructorOnly ictx: Context) extends TreeMapWithImplicits { this: {} TreeMapWithStages =>
2222

2323
import tpd._
2424
import TreeMapWithStages._

tests/pos-with-compiler-cc/dotc/transform/init/Semantic.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ object Semantic:
515515
object Reporter:
516516
class BufferedReporter extends Reporter:
517517
private val buf = new mutable.ArrayBuffer[Error]
518-
def errors = buf.toList
518+
def errors: List[Error] = buf.toList
519519
def report(err: Error) = buf += err
520520

521521
class TryBufferedReporter(backup: Cache) extends BufferedReporter with TryReporter:

0 commit comments

Comments
 (0)