Skip to content

Conversation

@Atharva1723
Copy link

Purpose

When printing array types whose element type is an unnamed union, diagnostics
previously displayed them without parentheses (e.g., '1|2|3[]') instead of
the correct '(1|2|3)[]'. This could lead to confusion when reading type errors.

Fixes ##35018

Approach

  • Updated BArrayType.toString() to wrap unnamed unions in parentheses.
  • Ensured diagnostic printing uses the same string representation.

The error message now generated is as expected
fixed_syntax_error

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