@@ -96,11 +96,11 @@ object Contexts {
96
96
atPhase(if ! limit.exists || limit <= currentPhase then currentPhase else limit)(op)
97
97
98
98
inline def currentPeriod (using ctx : Ctx , cs : CState ): Period =
99
- assertSamePeriod()
99
+ // assertSamePeriod()
100
100
cs
101
101
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")
104
104
105
105
inline def currentPhase (using ctx : Ctx , cs : CState ): Phase = ctx.base.phases(currentPeriod.firstPhaseId)
106
106
@@ -757,21 +757,7 @@ object Contexts {
757
757
def withNotNullInfos (infos : List [NotNullInfo ])(using CState ): Ctx =
758
758
if c.notNullInfos eq infos then c else c.fresh.setNotNullInfos(infos)
759
759
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
- }
769
760
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
- */
775
761
/** Test `op` in a fresh context with a typerstate that is not committable.
776
762
* The passed context may not survive the operation.
777
763
*/
0 commit comments