Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement context validation on parse #2336

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ksss
Copy link
Collaborator

@ksss ksss commented Mar 18, 2025

Contextual limitations are now performed at parse time.

This change was originally planned for version 3.4 but remained unaddressed.

We plan to change the parser to reject those types if it breaks the contextual limitations in next release -- 3.4.

I propose introducing it with the release of version 4.0.

Changes

  • The check will only be performed in Parser.parse_signature.
  • RBS::UnitTest, they have not been removed in this PR.
  • Deprecate --[no-]exit-error-on-syntax-error option.
  • Raise RBS::ParsingError instead of RBS::WillSyntaxError.
  • Remove RBS::WillSyntaxError.
  • Contextual limitations checks in the rbs validate command have been stopped.
  • Gave up analyzing CONST: self in the rbs prototype rb.

Not changes

  • I have not changed that RBS::ParsingError is raised for compatibility with Steep. It may be possible to use a different error name.
  • Parser.parse_type and Parser.parse_method_type do not currently perform checks. It might be worth adding them.
  • Since has_self_type?, has_classish_type?, and with_nonreturn_void? are used in RBS::UnitTest, they have not been removed in this PR.

@ksss ksss marked this pull request as ready for review March 19, 2025 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant