Skip to content

Commit 33aa9cb

Browse files
committed
Convert more context functions to CFTs
1 parent 396d39f commit 33aa9cb

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class Definitions {
204204
@tu lazy val ScalaPackageClass: ClassSymbol = {
205205
val cls = ScalaPackageVal.moduleClass.asClass
206206
cls.info.decls.openForMutations.useSynthesizer(
207-
name => ctx =>
207+
name =>
208208
if (name.isTypeName && name.isSyntheticFunction) newFunctionNTrait(name.asTypeName)
209209
else NoSymbol)
210210
cls

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ object Scopes {
4242
* the given name in the given context. Returns `NoSymbol` if the
4343
* no symbol should be synthesized for the given name.
4444
*/
45-
type SymbolSynthesizer = Name => Context => Symbol
45+
type SymbolSynthesizer = Name => Context ?=> Symbol
4646

4747
class ScopeEntry private[Scopes] (val name: Name, _sym: Symbol, val owner: Scope) {
4848

@@ -370,7 +370,7 @@ object Scopes {
370370
e = e.prev
371371
}
372372
if ((e eq null) && (synthesize != null)) {
373-
val sym = synthesize(name)(ctx)
373+
val sym = synthesize(name)
374374
if (sym.exists) newScopeEntry(sym) else e
375375
}
376376
else e

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ object SymbolLoaders {
206206
override def sourceModule(using Context): TermSymbol = _sourceModule
207207
def description(using Context): String = "package loader " + sourceModule.fullName
208208

209-
private var enterFlatClasses: Option[Context => Unit] = None
209+
private var enterFlatClasses: Option[() => Context ?=> Unit] = None
210210

211211
Stats.record("package scopes")
212212

@@ -226,14 +226,14 @@ object SymbolLoaders {
226226
if (e != null) e
227227
else if (isFlatName(mangled.toSimpleName) && enterFlatClasses.isDefined) {
228228
Stats.record("package scopes with flatnames entered")
229-
enterFlatClasses.get(ctx)
229+
enterFlatClasses.get()
230230
lookupEntry(name)
231231
}
232232
else e
233233
}
234234

235235
override def ensureComplete()(using Context): Unit =
236-
for (enter <- enterFlatClasses) enter(ctx)
236+
for (enter <- enterFlatClasses) enter()
237237

238238
override def newScopeLikeThis(): PackageScope = new PackageScope
239239
}
@@ -283,7 +283,7 @@ object SymbolLoaders {
283283

284284
val packageName = if (root.isEffectiveRoot) "" else root.symbol.javaClassName
285285

286-
enterFlatClasses = Some { ctx =>
286+
enterFlatClasses = Some { () =>
287287
enterFlatClasses = None
288288
inContext(ctx){enterClasses(root, packageName, flat = true)}
289289
}

0 commit comments

Comments
 (0)