v icon indicating copy to clipboard operation
v copied to clipboard

checker: avoid &Type as generic concrete type on usage

Open felipensp opened this issue 2 years ago • 1 comments

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)

felipensp avatar Jun 14 '23 13:06 felipensp

What is the status of this PR?

Delta456 avatar Jun 30 '23 06:06 Delta456