You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix validity period of derived SingleDenotations (#19983)
When running:
val f: ( => Int) => Int = i => i ; f(1)
twice in the REPL, the second time crashed with a ClassCastException.
The difference is that in the second run, the denotation for `f.apply`
is created from the SymDenotation for `Function1#apply` which already
exists and is known to be valid in every phase, but that doesn't mean
that the derived denotation for `f.apply` has the same validity: unlike
the SymDenotation it needs to be transformed (in particular to run the
`ElimByName` transformer).
It turns out that there were multiple places in the compiler where we
created a new denotation with a validity based on the existing one when
this was not legitimate. I've gone through all these places and replaced
them by `currentStablePeriod`.
Fixes#18756.
0 commit comments