type OneD = []Thing causes unexpected behaviour #22170
Labels
Bug
This tag is applied to issues which reports bugs.
Unit: Compiler
Bugs/feature requests, that are related to the V compiler in general.
Describe the bug
Identical functions except one uses a type alias for an array and the other does not behave differently.
The one using an alias also generates bad code (as seen in the debugger).
See example below.
Reproduction Steps
Compile and run this:
Expected Behavior
I expect good() and bad() to behave the same.
Current Behavior
bad() produces a rubbish two_d array
Possible Solution
do not use a type alias
Additional Information/Context
No response
V version
V 0.4.7 294f7e4.ae9456a
Environment details (OS name and version, etc.)
The text was updated successfully, but these errors were encountered: