cgen error - unwrapping an option field in a struct doesn't seem to unwrap it correctly #22892
Labels
Bug
This tag is applied to issues which reports bugs.
Option Type
Bugs/feature requests, that are related to `?Type`.
Status: Confirmed
This bug has been confirmed to be valid by a contributor.
Unit: cgen
Bugs/feature requests, that are related to the default C generating backend.
Unit: Compiler
Bugs/feature requests, that are related to the V compiler in general.
Describe the bug
Unwrapping an option field in a struct doesn't seem to be correctly unwrapped.
Reproduction Steps
Code: https://play.vlang.io/p/5b48070739
Expected Behavior
Unwrapping an option field in a struct with
if
should not ask to unwrap it againCurrent Behavior
Output:
Possible Solution
Extracting the struct option field in a variable, then unwrap it with a
if
.Additional Information/Context
No response
V version
V 0.4.8 f1333be.5bba92a
Environment details (OS name and version, etc.)
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
Huly®: V_0.6-21335
The text was updated successfully, but these errors were encountered: