Skip to content

Commit 4d8927b

Browse files
committed
Drop assertSamePeriod
1 parent c640a35 commit 4d8927b

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

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

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ object Contexts {
9696
atPhase(if !limit.exists || limit <= currentPhase then currentPhase else limit)(op)
9797

9898
inline def currentPeriod(using ctx: Ctx, cs: CState): Period =
99-
assertSamePeriod()
99+
// assertSamePeriod()
100100
cs
101101

102-
def assertSamePeriod()(using ctx: Ctx, cs: CState) =
103-
assert(ctx.asInstanceOf[Context].period == cs, s"period discrepancy, in context = ${ctx.asInstanceOf[Context].period}, state = $cs")
102+
def assertSamePeriod()(using ctx: Ctx, cs: CState) = ()
103+
// assert(ctx.asInstanceOf[Context].period == cs, s"period discrepancy, in context = ${ctx.asInstanceOf[Context].period}, state = $cs")
104104

105105
inline def currentPhase(using ctx: Ctx, cs: CState): Phase = ctx.base.phases(currentPeriod.firstPhaseId)
106106

@@ -757,21 +757,7 @@ object Contexts {
757757
def withNotNullInfos(infos: List[NotNullInfo])(using CState): Ctx =
758758
if c.notNullInfos eq infos then c else c.fresh.setNotNullInfos(infos)
759759
end ops
760-
/*
761-
// TODO: Fix issue when converting ModeChanges and FreshModeChanges to extension givens
762-
implicit class ModeChanges(val c: Context) extends AnyVal {
763-
final def withModeBits(mode: Mode): Context =
764-
if (mode != c.mode) c.fresh.setMode(mode) else c
765-
766-
final def addMode(mode: Mode): Context = withModeBits(c.mode | mode)
767-
final def retractMode(mode: Mode): Context = withModeBits(c.mode &~ mode)
768-
}
769760

770-
implicit class FreshModeChanges(val c: FreshContext) extends AnyVal {
771-
final def addMode(mode: Mode): c.type = c.setMode(c.mode | mode)
772-
final def retractMode(mode: Mode): c.type = c.setMode(c.mode &~ mode)
773-
}
774-
*/
775761
/** Test `op` in a fresh context with a typerstate that is not committable.
776762
* The passed context may not survive the operation.
777763
*/

0 commit comments

Comments
 (0)