V checker should not allow passing pointers for the values of option struct fields #19378
Labels
Bug
This tag is applied to issues which reports bugs.
Unit: Checker
Bugs/feature requests, that are related to the type checker.
Unit: Compiler
Bugs/feature requests, that are related to the V compiler in general.
Unit: Type System
Bugs/feature requests, that are related to the V types system.
Describe the bug
Only
none
, or a valid value from the respective type should be allowed for struct fields, typed as?Type
.Currently, instead V also allows passing pointers to such values.
Reproduction Steps
Expected Behavior
A checker error, telling me that
age: &age
is not allowed, and perhaps suggesting, that I passage: age
instead. Same, but forname: &name
too.Current Behavior
Possible Solution
No response
Additional Information/Context
No response
V version
latest v
Environment details (OS name and version, etc.)
Ubuntu 20.04
Important
You can vote for this issue using the 👍 reaction. More votes increase the issue's priority
for developers.
Take into account that only the 👍 reaction counts as a vote.
Only reactions to the issue itself will be counted as votes, not comments.
The text was updated successfully, but these errors were encountered: