Skip to content

Commit 25cdd9e

Browse files
Merge pull request #8238 from dotty-staging/update-context-function-syntax
Update to new context function and arguments syntax
2 parents ad32b12 + f8162e5 commit 25cdd9e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+300
-300
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class CompilationUnit protected (val source: SourceFile) {
4343

4444
var suspended: Boolean = false
4545

46-
def suspend()(given ctx: Context): Nothing =
46+
def suspend()(using ctx: Context): Nothing =
4747
if !suspended then
4848
if (ctx.settings.XprintSuspension.value)
4949
ctx.echo(i"suspended: $this")
@@ -57,7 +57,7 @@ class CompilationUnit protected (val source: SourceFile) {
5757
* that can be tracked for being not null to the list of spans of assignments
5858
* to these variables.
5959
*/
60-
def assignmentSpans(given Context): Map[Int, List[Span]] =
60+
def assignmentSpans(using Context): Map[Int, List[Span]] =
6161
if myAssignmentSpans == null then myAssignmentSpans = Nullables.assignmentSpans
6262
myAssignmentSpans
6363
}

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ object desugar {
929929
*/
930930

931931
def makeExtensionDef(mdef: Tree, tparams: List[TypeDef], leadingParams: List[ValDef],
932-
givenParamss: List[List[ValDef]])(given ctx: Context): Tree = {
932+
givenParamss: List[List[ValDef]])(using ctx: Context): Tree = {
933933
val allowed = "allowed here, since collective parameters are given"
934934
mdef match {
935935
case mdef: DefDef =>
@@ -986,7 +986,7 @@ object desugar {
986986
}
987987

988988
/** Invent a name for an anonympus given or extension of type or template `impl`. */
989-
def inventGivenOrExtensionName(impl: Tree)(given ctx: Context): SimpleName =
989+
def inventGivenOrExtensionName(impl: Tree)(using ctx: Context): SimpleName =
990990
val str = impl match
991991
case impl: Template =>
992992
if impl.parents.isEmpty then
@@ -1253,7 +1253,7 @@ object desugar {
12531253
else Apply(ref(tupleTypeRef.classSymbol.companionModule.termRef), ts)
12541254
}
12551255

1256-
private def isTopLevelDef(stat: Tree)(given Context): Boolean = stat match
1256+
private def isTopLevelDef(stat: Tree)(using Context): Boolean = stat match
12571257
case _: ValDef | _: PatDef | _: DefDef | _: Export => true
12581258
case stat: ModuleDef =>
12591259
stat.mods.isOneOf(GivenOrImplicit)

compiler/src/dotty/tools/dotc/ast/MainProxies.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import ast.Trees._
2626
*/
2727
object MainProxies {
2828

29-
def mainProxies(stats: List[tpd.Tree])(given Context): List[untpd.Tree] = {
29+
def mainProxies(stats: List[tpd.Tree])(using Context): List[untpd.Tree] = {
3030
import tpd._
3131
def mainMethods(stats: List[Tree]): List[Symbol] = stats.flatMap {
3232
case stat: DefDef if stat.symbol.hasAnnotation(defn.MainAnnot) =>
@@ -40,7 +40,7 @@ object MainProxies {
4040
}
4141

4242
import untpd._
43-
def mainProxy(mainFun: Symbol)(given ctx: Context): List[TypeDef] = {
43+
def mainProxy(mainFun: Symbol)(using ctx: Context): List[TypeDef] = {
4444
val mainAnnotSpan = mainFun.getAnnotation(defn.MainAnnot).get.tree.span
4545
def pos = mainFun.sourcePos
4646
val argsRef = Ident(nme.args)

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,10 +869,10 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
869869
* A not-null assertion for reference `x` has the form `x.$asInstanceOf$[x.type & T]`.
870870
*/
871871
object AssertNotNull with
872-
def apply(tree: tpd.Tree, tpnn: Type)(given Context): tpd.Tree =
872+
def apply(tree: tpd.Tree, tpnn: Type)(using Context): tpd.Tree =
873873
tree.select(defn.Any_typeCast).appliedToType(AndType(tree.tpe, tpnn))
874874

875-
def unapply(tree: tpd.TypeApply)(given Context): Option[tpd.Tree] = tree match
875+
def unapply(tree: tpd.TypeApply)(using Context): Option[tpd.Tree] = tree match
876876
case TypeApply(Select(qual: RefTree, nme.asInstanceOfPM), arg :: Nil) =>
877877
arg.tpe match
878878
case AndType(ref, _) if qual.tpe eq ref => Some(qual)

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
878878
Apply(tree, args)
879879

880880
/** An applied node that accepts only varargs as arguments */
881-
def appliedToVarargs(args: List[Tree], tpt: Tree)(given Context): Tree =
881+
def appliedToVarargs(args: List[Tree], tpt: Tree)(using Context): Tree =
882882
appliedTo(repeated(args, tpt))
883883

884884
/** The current tree applied to given argument lists:
@@ -1378,7 +1378,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
13781378
/** Convert a list of trees to a vararg-compatible tree.
13791379
* Used to make arguments for methods that accept varargs.
13801380
*/
1381-
def repeated(trees: List[Tree], tpt: Tree)(given ctx: Context): Tree =
1381+
def repeated(trees: List[Tree], tpt: Tree)(using ctx: Context): Tree =
13821382
ctx.typeAssigner.arrayToRepeated(JavaSeqLiteral(trees, tpt))
13831383

13841384
/** Create a tree representing a list containing all
@@ -1390,7 +1390,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
13901390
* @param tpe the type of the elements of the resulting list.
13911391
*
13921392
*/
1393-
def mkList(trees: List[Tree], tpe: Tree)(given Context): Tree =
1393+
def mkList(trees: List[Tree], tpe: Tree)(using Context): Tree =
13941394
ref(defn.ListModule).select(nme.apply)
13951395
.appliedToTypeTree(tpe)
13961396
.appliedToVarargs(trees, tpe)

compiler/src/dotty/tools/dotc/ast/untpd.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
246246
* describe the core of a construct whereas the existing set are the modifiers
247247
* given in the source.
248248
*/
249-
def withAddedFlags(flags: FlagSet, span: Span)(given ctx: Context): Modifiers =
249+
def withAddedFlags(flags: FlagSet, span: Span)(using ctx: Context): Modifiers =
250250
if this.flags.isAllOf(flags) then this
251251
else if compatible(this.flags, flags) then this | flags
252252
else

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import util.Spans.Span
1010

1111
object Annotations {
1212

13-
def annotClass(tree: Tree)(given Context) =
13+
def annotClass(tree: Tree)(using Context) =
1414
if (tree.symbol.isConstructor) tree.symbol.owner
1515
else tree.tpe.typeSymbol
1616

@@ -118,25 +118,25 @@ object Annotations {
118118
apply(New(atp, args))
119119

120120
/** Create an annotation where the tree is computed lazily. */
121-
def deferred(sym: Symbol)(treeFn: (given Context) => Tree)(implicit ctx: Context): Annotation =
121+
def deferred(sym: Symbol)(treeFn: Context ?=> Tree)(implicit ctx: Context): Annotation =
122122
new LazyAnnotation {
123123
override def symbol(implicit ctx: Context): Symbol = sym
124-
def complete(implicit ctx: Context) = treeFn(given ctx)
124+
def complete(implicit ctx: Context) = treeFn(using ctx)
125125
}
126126

127127
/** Create an annotation where the symbol and the tree are computed lazily. */
128-
def deferredSymAndTree(symf: (given Context) => Symbol)(treeFn: (given Context) => Tree)(implicit ctx: Context): Annotation =
128+
def deferredSymAndTree(symf: Context ?=> Symbol)(treeFn: Context ?=> Tree)(implicit ctx: Context): Annotation =
129129
new LazyAnnotation {
130130
private var mySym: Symbol = _
131131

132132
override def symbol(implicit ctx: Context): Symbol = {
133133
if (mySym == null || mySym.defRunId != ctx.runId) {
134-
mySym = symf(given ctx)
134+
mySym = symf(using ctx)
135135
assert(mySym != null)
136136
}
137137
mySym
138138
}
139-
def complete(implicit ctx: Context) = treeFn(given ctx)
139+
def complete(implicit ctx: Context) = treeFn(using ctx)
140140
}
141141

142142
def deferred(atp: Type, args: List[Tree])(implicit ctx: Context): Annotation =
@@ -153,8 +153,8 @@ object Annotations {
153153
object Child {
154154

155155
/** A deferred annotation to the result of a given child computation */
156-
def later(delayedSym: (given Context) => Symbol, span: Span)(implicit ctx: Context): Annotation = {
157-
def makeChildLater(given ctx: Context) = {
156+
def later(delayedSym: Context ?=> Symbol, span: Span)(implicit ctx: Context): Annotation = {
157+
def makeChildLater(using ctx: Context) = {
158158
val sym = delayedSym
159159
New(defn.ChildAnnot.typeRef.appliedTo(sym.owner.thisType.select(sym.name, sym)), Nil)
160160
.withSpan(span)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ object Contexts {
5151
private val initialStore = store8
5252

5353
/** The current context */
54-
def curCtx(given ctx: Context): Context = ctx
54+
def curCtx(using ctx: Context): Context = ctx
5555

5656
/** A context is passed basically everywhere in dotc.
5757
* This is convenient but carries the risk of captured contexts in
@@ -319,7 +319,7 @@ object Contexts {
319319
/** Run `op` as if it was run in a fresh explore typer state, but possibly
320320
* optimized to re-use the current typer state.
321321
*/
322-
final def test[T](op: (given Context) => T): T = typerState.test(op)(this)
322+
final def test[T](op: Context ?=> T): T = typerState.test(op)(this)
323323

324324
/** Is this a context for the members of a class definition? */
325325
def isClassDefContext: Boolean =

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ object Decorators {
188188

189189
implicit class reportDeco[T](x: T) extends AnyVal {
190190
def reporting(
191-
op: (given WrappedResult[T]) => String,
191+
op: WrappedResult[T] ?=> String,
192192
printer: config.Printers.Printer = config.Printers.default): T = {
193-
printer.println(op(given WrappedResult(x)))
193+
printer.println(op(using WrappedResult(x)))
194194
x
195195
}
196196
}

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class Definitions {
9292
* ContextFunctionN traits follow this template:
9393
*
9494
* trait ContextFunctionN[T0,...,T{N-1}, R] extends Object {
95-
* def apply(given $x0: T0, ..., $x{N_1}: T{N-1}): R
95+
* def apply(using $x0: T0, ..., $x{N_1}: T{N-1}): R
9696
* }
9797
*
9898
* ErasedFunctionN traits follow this template:
@@ -104,7 +104,7 @@ class Definitions {
104104
* ErasedContextFunctionN traits follow this template:
105105
*
106106
* trait ErasedContextFunctionN[T0,...,T{N-1}, R] extends Object {
107-
* def apply (given erased $x0: T0, ..., $x{N_1}: T{N-1}): R
107+
* def apply(using erased $x0: T0, ..., $x{N_1}: T{N-1}): R
108108
* }
109109
*
110110
* ErasedFunctionN and ErasedContextFunctionN erase to Function0.
@@ -439,7 +439,7 @@ class Definitions {
439439

440440
@tu lazy val CollectionSeqType: TypeRef = ctx.requiredClassRef("scala.collection.Seq")
441441
@tu lazy val SeqType: TypeRef = ctx.requiredClassRef("scala.collection.immutable.Seq")
442-
def SeqClass(given Context): ClassSymbol = SeqType.symbol.asClass
442+
def SeqClass(using Context): ClassSymbol = SeqType.symbol.asClass
443443
@tu lazy val Seq_apply : Symbol = SeqClass.requiredMethod(nme.apply)
444444
@tu lazy val Seq_head : Symbol = SeqClass.requiredMethod(nme.head)
445445
@tu lazy val Seq_drop : Symbol = SeqClass.requiredMethod(nme.drop)
@@ -448,7 +448,7 @@ class Definitions {
448448
@tu lazy val Seq_toSeq : Symbol = SeqClass.requiredMethod(nme.toSeq)
449449

450450
@tu lazy val ArrayType: TypeRef = ctx.requiredClassRef("scala.Array")
451-
def ArrayClass(given Context): ClassSymbol = ArrayType.symbol.asClass
451+
def ArrayClass(using Context): ClassSymbol = ArrayType.symbol.asClass
452452
@tu lazy val Array_apply : Symbol = ArrayClass.requiredMethod(nme.apply)
453453
@tu lazy val Array_update : Symbol = ArrayClass.requiredMethod(nme.update)
454454
@tu lazy val Array_length : Symbol = ArrayClass.requiredMethod(nme.length)
@@ -458,10 +458,10 @@ class Definitions {
458458
@tu lazy val ArrayModule: Symbol = ctx.requiredModule("scala.Array")
459459

460460
@tu lazy val UnitType: TypeRef = valueTypeRef("scala.Unit", java.lang.Void.TYPE, UnitEnc, nme.specializedTypeNames.Void)
461-
def UnitClass(given Context): ClassSymbol = UnitType.symbol.asClass
462-
def UnitModuleClass(given Context): Symbol = UnitType.symbol.asClass.linkedClass
461+
def UnitClass(using Context): ClassSymbol = UnitType.symbol.asClass
462+
def UnitModuleClass(using Context): Symbol = UnitType.symbol.asClass.linkedClass
463463
@tu lazy val BooleanType: TypeRef = valueTypeRef("scala.Boolean", java.lang.Boolean.TYPE, BooleanEnc, nme.specializedTypeNames.Boolean)
464-
def BooleanClass(given Context): ClassSymbol = BooleanType.symbol.asClass
464+
def BooleanClass(using Context): ClassSymbol = BooleanType.symbol.asClass
465465
@tu lazy val Boolean_! : Symbol = BooleanClass.requiredMethod(nme.UNARY_!)
466466
@tu lazy val Boolean_&& : Symbol = BooleanClass.requiredMethod(nme.ZAND) // ### harmonize required... calls
467467
@tu lazy val Boolean_|| : Symbol = BooleanClass.requiredMethod(nme.ZOR)
@@ -477,13 +477,13 @@ class Definitions {
477477
}).symbol
478478

479479
@tu lazy val ByteType: TypeRef = valueTypeRef("scala.Byte", java.lang.Byte.TYPE, ByteEnc, nme.specializedTypeNames.Byte)
480-
def ByteClass(given Context): ClassSymbol = ByteType.symbol.asClass
480+
def ByteClass(using Context): ClassSymbol = ByteType.symbol.asClass
481481
@tu lazy val ShortType: TypeRef = valueTypeRef("scala.Short", java.lang.Short.TYPE, ShortEnc, nme.specializedTypeNames.Short)
482-
def ShortClass(given Context): ClassSymbol = ShortType.symbol.asClass
482+
def ShortClass(using Context): ClassSymbol = ShortType.symbol.asClass
483483
@tu lazy val CharType: TypeRef = valueTypeRef("scala.Char", java.lang.Character.TYPE, CharEnc, nme.specializedTypeNames.Char)
484-
def CharClass(given Context): ClassSymbol = CharType.symbol.asClass
484+
def CharClass(using Context): ClassSymbol = CharType.symbol.asClass
485485
@tu lazy val IntType: TypeRef = valueTypeRef("scala.Int", java.lang.Integer.TYPE, IntEnc, nme.specializedTypeNames.Int)
486-
def IntClass(given Context): ClassSymbol = IntType.symbol.asClass
486+
def IntClass(using Context): ClassSymbol = IntType.symbol.asClass
487487
@tu lazy val Int_- : Symbol = IntClass.requiredMethod(nme.MINUS, List(IntType))
488488
@tu lazy val Int_+ : Symbol = IntClass.requiredMethod(nme.PLUS, List(IntType))
489489
@tu lazy val Int_/ : Symbol = IntClass.requiredMethod(nme.DIV, List(IntType))
@@ -492,19 +492,19 @@ class Definitions {
492492
@tu lazy val Int_>= : Symbol = IntClass.requiredMethod(nme.GE, List(IntType))
493493
@tu lazy val Int_<= : Symbol = IntClass.requiredMethod(nme.LE, List(IntType))
494494
@tu lazy val LongType: TypeRef = valueTypeRef("scala.Long", java.lang.Long.TYPE, LongEnc, nme.specializedTypeNames.Long)
495-
def LongClass(given Context): ClassSymbol = LongType.symbol.asClass
495+
def LongClass(using Context): ClassSymbol = LongType.symbol.asClass
496496
@tu lazy val Long_+ : Symbol = LongClass.requiredMethod(nme.PLUS, List(LongType))
497497
@tu lazy val Long_* : Symbol = LongClass.requiredMethod(nme.MUL, List(LongType))
498498
@tu lazy val Long_/ : Symbol = LongClass.requiredMethod(nme.DIV, List(LongType))
499499

500500
@tu lazy val FloatType: TypeRef = valueTypeRef("scala.Float", java.lang.Float.TYPE, FloatEnc, nme.specializedTypeNames.Float)
501-
def FloatClass(given Context): ClassSymbol = FloatType.symbol.asClass
501+
def FloatClass(using Context): ClassSymbol = FloatType.symbol.asClass
502502
@tu lazy val DoubleType: TypeRef = valueTypeRef("scala.Double", java.lang.Double.TYPE, DoubleEnc, nme.specializedTypeNames.Double)
503-
def DoubleClass(given Context): ClassSymbol = DoubleType.symbol.asClass
503+
def DoubleClass(using Context): ClassSymbol = DoubleType.symbol.asClass
504504

505505
@tu lazy val BoxedUnitClass: ClassSymbol = ctx.requiredClass("scala.runtime.BoxedUnit")
506-
def BoxedUnit_UNIT(given Context): TermSymbol = BoxedUnitClass.linkedClass.requiredValue("UNIT")
507-
def BoxedUnit_TYPE(given Context): TermSymbol = BoxedUnitClass.linkedClass.requiredValue("TYPE")
506+
def BoxedUnit_UNIT(using Context): TermSymbol = BoxedUnitClass.linkedClass.requiredValue("UNIT")
507+
def BoxedUnit_TYPE(using Context): TermSymbol = BoxedUnitClass.linkedClass.requiredValue("TYPE")
508508

509509
@tu lazy val BoxedBooleanClass: ClassSymbol = ctx.requiredClass("java.lang.Boolean")
510510
@tu lazy val BoxedByteClass : ClassSymbol = ctx.requiredClass("java.lang.Byte")
@@ -574,9 +574,9 @@ class Definitions {
574574
// in scalac modified to have Any as parent
575575

576576
@tu lazy val ThrowableType: TypeRef = ctx.requiredClassRef("java.lang.Throwable")
577-
def ThrowableClass(given Context): ClassSymbol = ThrowableType.symbol.asClass
577+
def ThrowableClass(using Context): ClassSymbol = ThrowableType.symbol.asClass
578578
@tu lazy val SerializableType: TypeRef = JavaSerializableClass.typeRef
579-
def SerializableClass(given Context): ClassSymbol = SerializableType.symbol.asClass
579+
def SerializableClass(using Context): ClassSymbol = SerializableType.symbol.asClass
580580

581581
@tu lazy val JavaEnumClass: ClassSymbol = {
582582
val cls = ctx.requiredClass("java.lang.Enum")

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ abstract class Periods { self: Context =>
2121
op(ctx.fresh.setPeriod(pd))
2222

2323
/** Execute `op` at given phase id */
24-
def atPhase[T](pid: PhaseId)(op: (given Context) => T): T =
25-
op(given ctx.withPhase(pid))
24+
def atPhase[T](pid: PhaseId)(op: Context ?=> T): T =
25+
op(using ctx.withPhase(pid))
2626

2727
/** The period containing the current period where denotations do not change.
2828
* We compute this by taking as first phase the first phase less or equal to

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ trait Phases {
3131
}
3232

3333
/** Execute `op` at given phase */
34-
def atPhase[T](phase: Phase)(op: (given Context) => T): T =
34+
def atPhase[T](phase: Phase)(op: Context ?=> T): T =
3535
atPhase(phase.id)(op)
3636

37-
def atNextPhase[T](op: (given Context) => T): T = atPhase(phase.next)(op)
37+
def atNextPhase[T](op: Context ?=> T): T = atPhase(phase.next)(op)
3838

39-
def atPhaseNotLaterThan[T](limit: Phase)(op: (given Context) => T): T =
40-
if (!limit.exists || phase <= limit) op(given this) else atPhase(limit)(op)
39+
def atPhaseNotLaterThan[T](limit: Phase)(op: Context ?=> T): T =
40+
if (!limit.exists || phase <= limit) op(using this) else atPhase(limit)(op)
4141

4242
def isAfterTyper: Boolean = base.isAfterTyper(phase)
4343
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ object SymDenotations {
436436
* of the opaque type definition.
437437
* @param rhs The right hand side tree of the type definition
438438
*/
439-
def opaqueToBounds(info: Type, rhs: tpd.Tree)(given Context): Type =
439+
def opaqueToBounds(info: Type, rhs: tpd.Tree)(using Context): Type =
440440

441441
def setAlias(tp: Type) =
442442
def recur(self: Type): Unit = self match
@@ -636,7 +636,7 @@ object SymDenotations {
636636
name.isPackageObjectName && owner.is(Package) && this.is(Module)
637637

638638
/** Is this symbol a toplevel definition in a package object? */
639-
def isWrappedToplevelDef(given Context): Boolean =
639+
def isWrappedToplevelDef(using Context): Boolean =
640640
!isConstructor && owner.isPackageObject
641641

642642
/** Is this symbol an abstract type? */
@@ -1086,7 +1086,7 @@ object SymDenotations {
10861086
/** A class is effectively sealed if has the `final` or `sealed` modifier, or it
10871087
* is defined in Scala 3 and is neither abstract nor open.
10881088
*/
1089-
final def isEffectivelySealed(given Context): Boolean =
1089+
final def isEffectivelySealed(using Context): Boolean =
10901090
isOneOf(FinalOrSealed) || isClass && !isOneOf(EffectivelyOpenFlags)
10911091

10921092
/** The class containing this denotation which has the given effective name. */
@@ -1546,7 +1546,7 @@ object SymDenotations {
15461546
myBaseTypeCachePeriod = Nowhere
15471547
}
15481548

1549-
def invalidateMemberCaches(sym: Symbol)(given Context): Unit =
1549+
def invalidateMemberCaches(sym: Symbol)(using Context): Unit =
15501550
if myMemberCache != null then myMemberCache.invalidate(sym.name)
15511551
if !sym.flagsUNSAFE.is(Private) then
15521552
invalidateMemberNamesCache()
@@ -1753,7 +1753,7 @@ object SymDenotations {
17531753
}
17541754

17551755
/** Enter a symbol in given `scope` without potentially replacing the old copy. */
1756-
def enterNoReplace(sym: Symbol, scope: MutableScope)(given Context): Unit =
1756+
def enterNoReplace(sym: Symbol, scope: MutableScope)(using Context): Unit =
17571757
scope.enter(sym)
17581758
invalidateMemberCaches(sym)
17591759

@@ -2267,7 +2267,7 @@ object SymDenotations {
22672267
* - parameters and parameter accessors, since their Local status is already
22682268
* determined by whether they have a `val` or `var` or not.
22692269
*/
2270-
def canBeLocal(name: Name, flags: FlagSet)(given Context) =
2270+
def canBeLocal(name: Name, flags: FlagSet)(using Context) =
22712271
!name.isConstructorName && !flags.is(Param) && !flags.is(ParamAccessor)
22722272

22732273
// ---- Completion --------------------------------------------------------

0 commit comments

Comments
 (0)