Skip to content

Commit 97faee5

Browse files
committed
Rename methods on FreshContext to make mutation obvious
And avoid name clashes
1 parent a6419fb commit 97faee5

19 files changed

+88
-88
lines changed

src/dotty/tools/dotc/Compiler.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ class Compiler {
4242
ctx.usePhases(phases)
4343
val rootScope = new MutableScope
4444
val bootstrap = ctx.fresh
45-
.withPeriod(Period(nextRunId, FirstPhaseId))
46-
.withScope(rootScope)
45+
.setPeriod(Period(nextRunId, FirstPhaseId))
46+
.setScope(rootScope)
4747
rootScope.enter(ctx.definitions.RootPackage)(bootstrap)
4848
val start = bootstrap.fresh
49-
.withOwner(defn.RootClass)
50-
.withTyper(new Typer)
51-
.withNewMode(Mode.ImplicitsEnabled)
52-
.withTyperState(new MutableTyperState(ctx.typerState, new ConsoleReporter()(ctx), isCommittable = true))
49+
.setOwner(defn.RootClass)
50+
.setTyper(new Typer)
51+
.setMode(Mode.ImplicitsEnabled)
52+
.setTyperState(new MutableTyperState(ctx.typerState, new ConsoleReporter()(ctx), isCommittable = true))
5353
ctx.definitions.init(start) // set context of definitions to start
5454
def addImport(ctx: Context, sym: Symbol) =
55-
ctx.fresh.withImportInfo(ImportInfo.rootImport(sym)(ctx))
56-
(start.withRunInfo(new RunInfo(start)) /: defn.RootImports)(addImport)
55+
ctx.fresh.setImportInfo(ImportInfo.rootImport(sym)(ctx))
56+
(start.setRunInfo(new RunInfo(start)) /: defn.RootImports)(addImport)
5757
}
5858

5959
def newRun(implicit ctx: Context): Run = {

src/dotty/tools/dotc/Driver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ abstract class Driver extends DotClass {
2424

2525
def process(args: Array[String]): Reporter = {
2626
val summary = CompilerCommand.distill(args)(initCtx)
27-
implicit val ctx: Context = initCtx.fresh.withSettings(summary.sstate)
27+
implicit val ctx: Context = initCtx.fresh.setSettings(summary.sstate)
2828
val fileNames = CompilerCommand.checkUsage(summary)
2929
try {
3030
doCompile(newCompiler(), fileNames)

src/dotty/tools/dotc/config/PathResolver.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ object PathResolver {
135135

136136
def fromPathString(path: String)(implicit ctx: Context): JavaClassPath = {
137137
val settings = ctx.settings.classpath.update(path)
138-
new PathResolver()(ctx.fresh.withSettings(settings)).result
138+
new PathResolver()(ctx.fresh.setSettings(settings)).result
139139
}
140140

141141
/** With no arguments, show the interesting values in Environment and Defaults.
@@ -152,7 +152,7 @@ object PathResolver {
152152
val ArgsSummary(sstate, rest, errors) =
153153
ctx.settings.processArguments(args.toList, true)
154154
errors.foreach(println)
155-
val pr = new PathResolver()(ctx.fresh.withSettings(sstate))
155+
val pr = new PathResolver()(ctx.fresh.setSettings(sstate))
156156
println(" COMMAND: 'scala %s'".format(args.mkString(" ")))
157157
println("RESIDUAL: 'scala %s'\n".format(rest.mkString(" ")))
158158
pr.result.show

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

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ object Contexts {
278278
}
279279

280280
final def withMode(mode: Mode): Context =
281-
if (mode != this.mode) fresh.withNewMode(mode) else this
281+
if (mode != this.mode) fresh.setMode(mode) else this
282282

283283
final def withPhase(phase: PhaseId): Context =
284-
if (this.phaseId == phaseId) this else fresh.withNewPhase(phase)
284+
if (this.phaseId == phaseId) this else fresh.setPhase(phase)
285285
final def withPhase(phase: Phase): Context =
286286
withPhase(phase.id)
287287

@@ -306,36 +306,36 @@ object Contexts {
306306
* of its attributes using the with... methods.
307307
*/
308308
abstract class FreshContext extends Context {
309-
def withPeriod(period: Period): this.type = { this.period = period; this }
310-
def withNewMode(mode: Mode): this.type = { this.mode = mode; this }
311-
def withTyperState(typerState: TyperState): this.type = { this.typerState = typerState; this }
312-
def withNewTyperState: this.type = withTyperState(typerState.fresh(isCommittable = true))
313-
def withExploreTyperState: this.type = withTyperState(typerState.fresh(isCommittable = false))
314-
def withPrinterFn(printer: Context => Printer): this.type = { this.printerFn = printer; this }
315-
def withOwner(owner: Symbol): this.type = { assert(owner != NoSymbol); this.owner = owner; this }
316-
def withSettings(sstate: SettingsState): this.type = { this.sstate = sstate; this }
317-
def withCompilationUnit(compilationUnit: CompilationUnit): this.type = { this.compilationUnit = compilationUnit; this }
318-
def withTree(tree: Tree[_ >: Untyped]): this.type = { this.tree = tree; this }
319-
def withScope(scope: Scope): this.type = { this.scope = scope; this }
320-
def withNewScope: this.type = { this.scope = newScope; this }
321-
def withTypeAssigner(typeAssigner: TypeAssigner): this.type = { this.typeAssigner = typeAssigner; this }
322-
def withTyper(typer: Typer): this.type = { this.scope = typer.scope; withTypeAssigner(typer) }
323-
def withImportInfo(importInfo: ImportInfo): this.type = { this.importInfo = importInfo; this }
324-
def withRunInfo(runInfo: RunInfo): this.type = { this.runInfo = runInfo; this }
325-
def withDiagnostics(diagnostics: Option[StringBuilder]): this.type = { this.diagnostics = diagnostics; this }
326-
def withTypeComparerFn(tcfn: Context => TypeComparer): this.type = { this.typeComparer = tcfn(this); this }
327-
def withSearchHistory(searchHistory: SearchHistory): this.type = { this.searchHistory = searchHistory; this }
328-
def withMoreProperties(moreProperties: Map[String, Any]): this.type = { this.moreProperties = moreProperties; this }
329-
330-
def withProperty(prop: (String, Any)): this.type = withMoreProperties(moreProperties + prop)
331-
332-
def withNewPhase(pid: PhaseId): this.type = withPeriod(Period(runId, pid))
333-
def withNewPhase(phase: Phase): this.type = withNewPhase(phase.id)
334-
335-
def withSetting[T](setting: Setting[T], value: T): this.type =
336-
withSettings(setting.updateIn(sstate, value))
337-
338-
def withDebug = withSetting(base.settings.debug, true)
309+
def setPeriod(period: Period): this.type = { this.period = period; this }
310+
def setMode(mode: Mode): this.type = { this.mode = mode; this }
311+
def setTyperState(typerState: TyperState): this.type = { this.typerState = typerState; this }
312+
def clearTyperState: this.type = setTyperState(typerState.fresh(isCommittable = true))
313+
def setExploreTyperState: this.type = setTyperState(typerState.fresh(isCommittable = false))
314+
def setPrinterFn(printer: Context => Printer): this.type = { this.printerFn = printer; this }
315+
def setOwner(owner: Symbol): this.type = { assert(owner != NoSymbol); this.owner = owner; this }
316+
def setSettings(sstate: SettingsState): this.type = { this.sstate = sstate; this }
317+
def setCompilationUnit(compilationUnit: CompilationUnit): this.type = { this.compilationUnit = compilationUnit; this }
318+
def setTree(tree: Tree[_ >: Untyped]): this.type = { this.tree = tree; this }
319+
def setScope(scope: Scope): this.type = { this.scope = scope; this }
320+
def clearScope: this.type = { this.scope = newScope; this }
321+
def setTypeAssigner(typeAssigner: TypeAssigner): this.type = { this.typeAssigner = typeAssigner; this }
322+
def setTyper(typer: Typer): this.type = { this.scope = typer.scope; setTypeAssigner(typer) }
323+
def setImportInfo(importInfo: ImportInfo): this.type = { this.importInfo = importInfo; this }
324+
def setRunInfo(runInfo: RunInfo): this.type = { this.runInfo = runInfo; this }
325+
def setDiagnostics(diagnostics: Option[StringBuilder]): this.type = { this.diagnostics = diagnostics; this }
326+
def setTypeComparerFn(tcfn: Context => TypeComparer): this.type = { this.typeComparer = tcfn(this); this }
327+
def setSearchHistory(searchHistory: SearchHistory): this.type = { this.searchHistory = searchHistory; this }
328+
def setMoreProperties(moreProperties: Map[String, Any]): this.type = { this.moreProperties = moreProperties; this }
329+
330+
def setProperty(prop: (String, Any)): this.type = setMoreProperties(moreProperties + prop)
331+
332+
def setPhase(pid: PhaseId): this.type = setPeriod(Period(runId, pid))
333+
def setPhase(phase: Phase): this.type = setPhase(phase.id)
334+
335+
def setSetting[T](setting: Setting[T], value: T): this.type =
336+
setSettings(setting.updateIn(sstate, value))
337+
338+
def setDebug = setSetting(base.settings.debug, true)
339339
}
340340

341341
/** A class defining the initial context with given context base

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ abstract class Periods extends DotClass { self: Context =>
1919

2020
/** Execute `op` at given period */
2121
def atPeriod[T](pd: Period)(op: Context => T): T =
22-
op(ctx.fresh.withPeriod(pd))
22+
op(ctx.fresh.setPeriod(pd))
2323

2424
/** Execute `op` at given phase id */
2525
def atPhase[T](pid: PhaseId)(op: Context => T): T =

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ object Phases {
163163
def run(implicit ctx: Context): Unit
164164

165165
def runOn(units: List[CompilationUnit])(implicit ctx: Context): Unit =
166-
for (unit <- units) run(ctx.fresh.withNewPhase(this).withCompilationUnit(unit))
166+
for (unit <- units) run(ctx.fresh.setPhase(this).setCompilationUnit(unit))
167167

168168
def description: String = name
169169

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ object SymDenotations {
13561356
val (location, src) =
13571357
if (file != null) (s" in $file", file.toString)
13581358
else ("", "the signature")
1359-
val name = ctx.fresh.withSetting(ctx.settings.debugNames, true).nameString(denot.name)
1359+
val name = ctx.fresh.setSetting(ctx.settings.debugNames, true).nameString(denot.name)
13601360
ctx.error(
13611361
s"""|bad symbolic reference. A signature$location
13621362
|refers to $name in ${denot.owner.showKind} ${denot.owner.showFullName} which is not available.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ object TypeComparer {
11341134

11351135
/** Show trace of comparison operations when performing `op` as result string */
11361136
def explained[T](op: Context => T)(implicit ctx: Context): String = {
1137-
val nestedCtx = ctx.fresh.withTypeComparerFn(new ExplainingTypeComparer(_))
1137+
val nestedCtx = ctx.fresh.setTypeComparerFn(new ExplainingTypeComparer(_))
11381138
op(nestedCtx)
11391139
nestedCtx.typeComparer.toString
11401140
}

src/dotty/tools/dotc/printing/Disambiguation.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ object Disambiguation {
7575
def disambiguated(op: Context => String)(implicit ctx: Context): String = {
7676
val dctx = ctx.printer match {
7777
case dp: Printer => ctx
78-
case _ => ctx.fresh.withPrinterFn(newPrinter)
78+
case _ => ctx.fresh.setPrinterFn(newPrinter)
7979
}
8080
val res = op(dctx)
8181
dctx.printer match {

src/dotty/tools/dotc/transform/LazyVals.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ class LazyValTranformContext {
249249
val flagSymbol = ctx.newSymbol(methodSymbol, "flag".toTermName, Flags.Mutable & Flags.Synthetic, defn.LongType)
250250
val flagDef = ValDef(flagSymbol, Literal(Constant(0L)))
251251

252-
val thiz = This(claz)(ctx.fresh.withOwner(claz))
252+
val thiz = This(claz)(ctx.fresh.setOwner(claz))
253253

254254
val resultSymbol = ctx.newSymbol(methodSymbol, "result".toTermName, Flags.Mutable & Flags.Synthetic, tp)
255255
val resultDef = ValDef(resultSymbol, Literal(initValue(tp.widen)))
@@ -313,7 +313,7 @@ class LazyValTranformContext {
313313

314314
val tpe = x.tpe.widen
315315
val claz = x.symbol.owner.asClass
316-
val thiz = This(claz)(ctx.fresh.withOwner(claz))
316+
val thiz = This(claz)(ctx.fresh.setOwner(claz))
317317
val companion = claz.companionModule
318318
val helperModule = ctx.requiredModule("dotty.runtime.LazyVals")
319319
val getOffset = Select(Ident(helperModule.termRef), LazyVals.Names.getOffset.toTermName)

src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,15 +712,15 @@ trait Applications extends Compatibility { self: Typer =>
712712
* @param resultType The expected result type of the application
713713
*/
714714
def isApplicable(methRef: TermRef, targs: List[Type], args: List[Tree], resultType: Type)(implicit ctx: Context): Boolean = {
715-
val nestedContext = ctx.fresh.withExploreTyperState
715+
val nestedContext = ctx.fresh.setExploreTyperState
716716
new ApplicableToTrees(methRef, targs, args, resultType)(nestedContext).success
717717
}
718718

719719
/** Is given method reference applicable to argument types `args`?
720720
* @param resultType The expected result type of the application
721721
*/
722722
def isApplicable(methRef: TermRef, args: List[Type], resultType: Type)(implicit ctx: Context): Boolean = {
723-
val nestedContext = ctx.fresh.withExploreTyperState
723+
val nestedContext = ctx.fresh.setExploreTyperState
724724
new ApplicableToTypes(methRef, args, resultType)(nestedContext).success
725725
}
726726

src/dotty/tools/dotc/typer/FrontEnd.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class FrontEnd extends Phase {
4141
}
4242

4343
override def runOn(units: List[CompilationUnit])(implicit ctx: Context): Unit = {
44-
val unitContexts = units map (unit => ctx.fresh.withCompilationUnit(unit))
44+
val unitContexts = units map (unit => ctx.fresh.setCompilationUnit(unit))
4545
unitContexts foreach (parse(_))
4646
record("parsedTrees", ast.Trees.ntrees)
4747
unitContexts foreach (enterSyms(_))

src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ object Implicits {
5050
case mt: MethodType =>
5151
mt.isImplicit ||
5252
mt.paramTypes.length != 1 ||
53-
!(argType <:< mt.paramTypes.head)(ctx.fresh.withExploreTyperState)
53+
!(argType <:< mt.paramTypes.head)(ctx.fresh.setExploreTyperState)
5454
case poly: PolyType =>
5555
poly.resultType match {
5656
case mt: MethodType =>
5757
mt.isImplicit ||
5858
mt.paramTypes.length != 1 ||
59-
!(argType <:< wildApprox(mt.paramTypes.head)(ctx.fresh.withExploreTyperState))
59+
!(argType <:< wildApprox(mt.paramTypes.head)(ctx.fresh.setExploreTyperState))
6060
case rtp =>
6161
discardForView(wildApprox(rtp), argType)
6262
}
@@ -90,7 +90,7 @@ object Implicits {
9090
}
9191

9292
if (refs.isEmpty) refs
93-
else refs filter (refMatches(_)(ctx.fresh.withExploreTyperState.addMode(Mode.TypevarsMissContext))) // create a defensive copy of ctx to avoid constraint pollution
93+
else refs filter (refMatches(_)(ctx.fresh.setExploreTyperState.addMode(Mode.TypevarsMissContext))) // create a defensive copy of ctx to avoid constraint pollution
9494
}
9595
}
9696

@@ -370,7 +370,7 @@ trait Implicits { self: Typer =>
370370
}
371371
case _ =>
372372
}
373-
inferView(dummyTreeOfType(from), to)(ctx.fresh.withExploreTyperState).isInstanceOf[SearchSuccess]
373+
inferView(dummyTreeOfType(from), to)(ctx.fresh.setExploreTyperState).isInstanceOf[SearchSuccess]
374374
}
375375
)
376376

@@ -419,7 +419,7 @@ trait Implicits { self: Typer =>
419419
/** An implicit search; parameters as in `inferImplicit` */
420420
class ImplicitSearch(protected val pt: Type, protected val argument: Tree, pos: Position)(implicit ctx: Context) {
421421

422-
private def nestedContext = ctx.fresh.withNewMode(ctx.mode &~ Mode.ImplicitsEnabled)
422+
private def nestedContext = ctx.fresh.setMode(ctx.mode &~ Mode.ImplicitsEnabled)
423423

424424
private def implicitProto(resultType: Type, f: Type => Type) =
425425
if (argument.isEmpty) f(resultType) else ViewProto(f(argument.tpe.widen), f(resultType))
@@ -457,7 +457,7 @@ trait Implicits { self: Typer =>
457457
pt)
458458
val generated1 = adapt(generated, pt)
459459
lazy val shadowing =
460-
typed(untpd.Ident(ref.name) withPos pos.toSynthetic, funProto)(nestedContext.withNewTyperState)
460+
typed(untpd.Ident(ref.name) withPos pos.toSynthetic, funProto)(nestedContext.clearTyperState)
461461
def refMatches(shadowing: Tree): Boolean =
462462
ref.symbol == closureBody(shadowing).symbol || {
463463
shadowing match {
@@ -485,12 +485,12 @@ trait Implicits { self: Typer =>
485485
val history = ctx.searchHistory nest wildProto
486486
val result =
487487
if (history eq ctx.searchHistory) divergingImplicit(ref)
488-
else typedImplicit(ref)(nestedContext.withNewTyperState.withSearchHistory(history))
488+
else typedImplicit(ref)(nestedContext.clearTyperState.setSearchHistory(history))
489489
result match {
490490
case fail: SearchFailure =>
491491
rankImplicits(pending1, acc)
492492
case best: SearchSuccess =>
493-
val newPending = pending1 filter (isAsGood(_, best.ref)(nestedContext.withExploreTyperState))
493+
val newPending = pending1 filter (isAsGood(_, best.ref)(nestedContext.setExploreTyperState))
494494
rankImplicits(newPending, best :: acc)
495495
}
496496
case nil => acc
@@ -499,7 +499,7 @@ trait Implicits { self: Typer =>
499499
/** Convert a (possibly empty) list of search successes into a single search result */
500500
def condense(hits: List[SearchSuccess]): SearchResult = hits match {
501501
case best :: alts =>
502-
alts find (alt => isAsGood(alt.ref, best.ref)(ctx.fresh.withExploreTyperState)) match {
502+
alts find (alt => isAsGood(alt.ref, best.ref)(ctx.fresh.setExploreTyperState)) match {
503503
case Some(alt) =>
504504
/* !!! DEBUG
505505
println(i"ambiguous refs: ${hits map (_.ref) map (_.show) mkString ", "}")

src/dotty/tools/dotc/typer/Inferencing.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ trait Inferencing { this: Checking =>
3030
* Variables that are successfully minimized do not count as uninstantiated.
3131
*/
3232
def isFullyDefined(tp: Type, force: ForceDegree.Value)(implicit ctx: Context): Boolean = {
33-
val nestedCtx = ctx.fresh.withNewTyperState
33+
val nestedCtx = ctx.fresh.clearTyperState
3434
val result = new IsFullyDefinedAccumulator(force)(nestedCtx).process(tp)
3535
if (result) nestedCtx.typerState.commit()
3636
result

src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,11 @@ class Namer { typer: Typer =>
288288

289289
/** A new context that summarizes an import statement */
290290
def importContext(sym: Symbol, selectors: List[Tree])(implicit ctx: Context) =
291-
ctx.fresh.withImportInfo(new ImportInfo(sym, selectors))
291+
ctx.fresh.setImportInfo(new ImportInfo(sym, selectors))
292292

293293
/** A new context for the interior of a class */
294294
def inClassContext(selfInfo: DotClass /* Should be Type | Symbol*/)(implicit ctx: Context): Context = {
295-
val localCtx: Context = ctx.fresh.withNewScope
295+
val localCtx: Context = ctx.fresh.clearScope
296296
selfInfo match {
297297
case sym: Symbol if sym.exists && sym.name != nme.WILDCARD =>
298298
localCtx.scope.asInstanceOf[MutableScope].enter(sym)
@@ -330,7 +330,7 @@ class Namer { typer: Typer =>
330330
def indexExpanded(stat: Tree)(implicit ctx: Context): Context = expanded(stat) match {
331331
case pcl: PackageDef =>
332332
val pkg = createPackageSymbol(pcl.pid)
333-
index(pcl.stats)(ctx.fresh.withOwner(pkg.moduleClass))
333+
index(pcl.stats)(ctx.fresh.setOwner(pkg.moduleClass))
334334
invalidateCompanions(pkg, Trees.flatten(pcl.stats map expanded))
335335
ctx
336336
case imp: Import =>
@@ -380,19 +380,19 @@ class Namer { typer: Typer =>
380380
/** The completer of a symbol defined by a member def or import (except ClassSymbols) */
381381
class Completer(val original: Tree)(implicit ctx: Context) extends LazyType {
382382

383-
protected def localContext(owner: Symbol) = ctx.fresh.withOwner(owner).withTree(original)
383+
protected def localContext(owner: Symbol) = ctx.fresh.setOwner(owner).setTree(original)
384384

385385
private def typeSig(sym: Symbol): Type = original match {
386386
case original: ValDef =>
387387
if (sym is Module) moduleValSig(sym)
388-
else valOrDefDefSig(original, sym, Nil, identity)(localContext(sym).withNewScope)
388+
else valOrDefDefSig(original, sym, Nil, identity)(localContext(sym).clearScope)
389389
case original: DefDef =>
390390
val typer1 = new Typer
391391
nestedTyper(sym) = typer1
392-
typer1.defDefSig(original, sym)(localContext(sym).withTyper(typer1))
392+
typer1.defDefSig(original, sym)(localContext(sym).setTyper(typer1))
393393
case original: TypeDef =>
394394
assert(!original.isClassDef)
395-
typeDefSig(original, sym)(localContext(sym).withNewScope)
395+
typeDefSig(original, sym)(localContext(sym).clearScope)
396396
case imp: Import =>
397397
try {
398398
val expr1 = typedAheadExpr(imp.expr, AnySelectionProto)

src/dotty/tools/dotc/typer/ProtoTypes.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ object ProtoTypes {
3838

3939
/** Test compatibility after normalization in a fresh typerstate. */
4040
def normalizedCompatible(tp: Type, pt: Type)(implicit ctx: Context) = {
41-
val nestedCtx = ctx.fresh.withExploreTyperState
41+
val nestedCtx = ctx.fresh.setExploreTyperState
4242
isCompatible(normalize(tp, pt)(nestedCtx), pt)(nestedCtx)
4343
}
4444

0 commit comments

Comments
 (0)