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
{{ message }}
Repository navigation
Commit 456ae10
Browse filesBrowse the repository at this point in the historyBrowse files
Forget non-final field initializers inside methods (#340)
A field initializer's instance stayed the field's last instance for the
whole class, so every method read a non-final field as if it still held
its initializer, although any other method (e.g. a setter) may have
reassigned it. Passing such a field to a refined parameter was accepted.
On entry to a method (constructors are unchanged), each non-final field
with a recorded value gets a fresh instance carrying only its declared
refinement. Final fields keep their initializer. Assignments made inside
the method are still tracked as before.
The field cases of the deferred-callback fixtures relied on the
initializer state of a non-final field in a method; they now check that
state in the constructor, where it does hold, so they keep testing that
creating a callback does not run it.
Fixes#340
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments