Skip to content

Restore scoped non-simple method type assertions - #3139

Open
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/scoped-type-assertions
Open

Restore scoped non-simple method type assertions#3139
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/scoped-type-assertions

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

allow_non_simple_method_type resets its flag only through rescue. It therefore swallows exceptions raised by the caller, fails to restore state after a successful scope, and breaks nested scopes by resetting the outer allowance.

Capture the prior value and restore it in ensure, allowing exceptions to propagate normally.

Verification

  • baseline models reproduce exception swallowing, successful-state leakage, and nested-scope loss; focused and cumulative candidates restore all three contracts
  • unit-test assertion coverage is included in the cumulative focused models
  • all 109 runtime files compile on Ruby 4.0.6
  • focused candidate syntax, RuboCop, and diff checks pass

Source-only change; no test file is included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant