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

parser: disallow having builtin type as type names for enum, sum type and alias #19043

Merged

Conversation

Delta456
Copy link
Member

@Delta456 Delta456 commented Aug 2, 2023

Closes #18957

🤖 Generated by Copilot at 39926c5

This pull request enhances the parser's validation of user-defined type names and adds tests for error messages. It prevents name collisions with built-in types for enum, sum type, and type alias declarations.

🤖 Generated by Copilot at 39926c5

  • Prevent name collisions between user-defined types and built-in types by adding more invalid type indices to the parser checks (link, link, link)
  • Add test files and source code for the error messages when a type alias, an enum, or a sum type name conflicts with a built-in type name, such as string, rune, or map (link, link, link, link, link, link)

@spytheman spytheman merged commit 6a4bfef into vlang:master Aug 3, 2023
49 checks passed
@Delta456 Delta456 deleted the parser_disallow_builtin_type_as_alias branch August 3, 2023 08:53
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.

no error using builtin types as type alias name
2 participants