open import Agda.Builtin.Equality
record R : Set where
eta-equality; inductive
field f : R
open R
loop : (let X = _) → X .f ≡ X .f → Set
loop refl = {!!} -- type checker loops
So we would like to issue a warning, possibly make this an error, possibly make this not --safe.
What complicates the situation is that the check (positivity) that detects the potential unsafety runs only at the end of mutual blocks. So we could issue the warning only then.
This could be too late anyway, as Agda might already have diverged using the stipulated eta-equality for the record type.
If we switch off eta after the fact (as in current PR #7470), we could lose subject reduction as eta has been available inside the mutual block but is not available after the check.
So we can for instance just warn about it. This would be the least invasive change. Would also mean that --safe does not prevent Agda from looping (doesn't anyway always, see 1.).
From: https://github.com/agda/agda/issues/7467#issuecomment-2326548333
From https://github.com/agda/agda/issues/7467#issuecomment-2327123945
So far our policy was: if the user writes
eta-equality
explicitly, they understand the risks. However, judging from @UlfNorell 's reaction in https://github.com/agda/agda/issues/7467#issuecomment-2327123945, this might not be the case.So we would like to issue a warning, possibly make this an error, possibly make this not
--safe
.What complicates the situation is that the check (positivity) that detects the potential unsafety runs only at the end of mutual blocks. So we could issue the warning only then.
eta-equality
for the record type.--safe
does not prevent Agda from looping (doesn't anyway always, see 1.).--safe
. In this case, we need to change the standard library as in https://github.com/agda/agda-stdlib/pull/2476.--safe
.