Skip to content

Return Diagnostic#rule as Symbol#884

Merged
st0012 merged 2 commits into
mainfrom
codex/diagnostic-rule-string
Jun 26, 2026
Merged

Return Diagnostic#rule as Symbol#884
st0012 merged 2 commits into
mainfrom
codex/diagnostic-rule-string

Conversation

@st0012

@st0012 st0012 commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problems

  • Rubydex::Diagnostic#rule is typed as a Symbol, but diagnostics were built with string rule values.
  • That mismatch makes runtime behavior disagree with the Ruby-facing API contract.

Solutions

  • Intern native diagnostic rule strings before constructing Rubydex::Diagnostic objects.
  • Update the parse-error diagnostic test to assert symbol rule values.

@st0012 st0012 marked this pull request as ready for review June 25, 2026 21:26
@st0012 st0012 requested a review from a team as a code owner June 25, 2026 21:26
@st0012 st0012 added the bugfix A change that fixes an existing bug label Jun 25, 2026

@vinistock vinistock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of changing the code to return a symbol instead? It seems nicer for these unique labels

@st0012 st0012 changed the title Type Diagnostic#rule as String Return Diagnostic#rule as Symbol Jun 26, 2026
@st0012 st0012 requested a review from vinistock June 26, 2026 17:26
@st0012 st0012 merged commit ff695e4 into main Jun 26, 2026
36 checks passed
@st0012 st0012 deleted the codex/diagnostic-rule-string branch June 26, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix A change that fixes an existing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants