generic function that is called with different generic types cannot infer correct generic type in sub call #19427
Labels
Bug
This tag is applied to issues which reports bugs.
Generics[T]
Bugs/feature requests, that are related to the V generics.
Unit: cgen
Bugs/feature requests, that are related to the default C generating backend.
Describe the bug
In the following code V cannot determine what generic type should be passed to
double_array(mut typ)
and always uses the last used type.The functions are generated, but the wrong generic function is used.
Reproduction Steps
Expected Behavior
no errors
Current Behavior
Possible Solution
I tried to fix it and found that
node.concrete_types
is correctly inferred fordouble_array
in the checker stage, but this is not present in cgen.Additional Information/Context
C code:
V version
V 0.4.1 V 0.4.1 a685088
Environment details (OS name and version, etc.)
V full version: V 0.4.1 a685088
OS: linux (WSL 2)
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: