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

@chiranSachintha
Copy link
Member

@Atharva1723 There are few test failures. Please check it. https://scans.gradle.com/s/wnnxihexudchq/tests/overview?outcome=FAILED

@Atharva1723 Atharva1723 force-pushed the fix-array-tostring-union branch from a546e25 to ad362c7 Compare November 24, 2025 05:32
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.

2 participants