-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Returning a return strange behaviour #22838
Copy link
Copy link
Closed
Labels
BugThis tag is applied to issues which reports bugs.This tag is applied to issues which reports bugs.Unit: cgenBugs/feature requests, that are related to the default C generating backend.Bugs/feature requests, that are related to the default C generating backend.
Metadata
Metadata
Assignees
Labels
BugThis tag is applied to issues which reports bugs.This tag is applied to issues which reports bugs.Unit: cgenBugs/feature requests, that are related to the default C generating backend.Bugs/feature requests, that are related to the default C generating backend.
Describe the bug
When a programmer by mistake use a twice unnecessary
returnstatement within areturn if { } else { }block, the code is accepted and the result is not logic.Reproduction Steps
Expected Behavior
Maybe first prevent the second
returncan be compiled or thatreturn return error('message')worked asreturn error('message').Current Behavior
Seems the error is not returned but is returned a pointer to
return error('something').Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.8 5092626
Environment details (OS name and version, etc.)
https://play.vlang.io/p/6c8f09ab31
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-21283