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

checker: avoid &Type as generic concrete type on usage #18447

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

felipensp
Copy link
Member

@felipensp felipensp commented Jun 14, 2023

Fix #18440
Fix #18367

🤖 Generated by Copilot at c6065ce

Prevent using reference types as generic concrete types in the compiler. Add a test case and an error message for this scenario.

🤖 Generated by Copilot at c6065ce

  • Report and test error when using reference type as generic concrete type (link, link, link)
  • Check for ampersand token after opening bracket in parse_type.v and call error_with_pos with message and position (link)
  • Add expected compiler error message in wrong_ref_type_as_concrete_err.out suggesting to use generic type parameter instead (link)
  • Add test case in wrong_ref_type_as_concrete_err.vv that imports datatypes module, defines heap-allocated struct User, and tries to create doubly linked list of references to User (link)

@Delta456
Copy link
Member

What is the status of this PR?

@spytheman spytheman added Needs Rebase The code of the PR must be rebased over current master before it can be approved. Breaking Change This PR introduces changes that break backward compatibility. Requires manual review. labels Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change This PR introduces changes that break backward compatibility. Requires manual review. Needs Rebase The code of the PR must be rebased over current master before it can be approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Referenced values are displayed incorrectly Error initializing DoublyLinkedList with reference type
3 participants