Skip to content

js: fix array type checking in sum type match expressions (fix #24237 ) - #24259

Merged
spytheman merged 1 commit into
vlang:masterfrom
gchumillas:fix_array_type_checking_in_sum_type_match_expressions
Apr 18, 2025
Merged

spytheman merged 1 commit into
vlang:masterfrom
gchumillas:fix_array_type_checking_in_sum_type_match_expressions

Conversation

@gchumillas

@gchumillas gchumillas commented Apr 17, 2025 •

Copy link
Copy Markdown
Contributor

This commit fixes a bug in the JavaScript code generator where array types in sum type match expressions were not being properly checked. The issue was that the generated code was checking if array elements were instances of the array type itself, rather than the element type of the array.

Fixes #24237

This commit fixes a bug in the JavaScript code generator where array types in sum type match expressions were not being properly checked. The issue was that the generated code was checking if array elements were instances of the array type itself, rather than the element type of the array.

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Excellent work.

@spytheman
spytheman merged commit 11e25bc into vlang:master Apr 18, 2025
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.

JS Backend: sum type doesn't work well with array types

2 participants