TypeInferenceError
with parametrized structs
#1523
Labels
Milestone
TypeInferenceError
with parametrized structs
#1523
Describe the bug
When parametrized function returns parametrized struct as an function value,
parser/type checker fails with
TypeInferenceError
.Struct has inferred parameters that aren't resolved during
InstantiateParametricFunction
.Code that triggers this bug:
Switching order of function calls results
in the following error:
To Reproduce
Steps to reproduce the behavior:
interpreter_main
file.x
interpreter_main file.x
Expected behavior
Interpreter should correctly deduce types for parametric structs.
Environment (this can be helpful for troubleshooting):
Additional context
Tested on the newest available main(ea5c4dc)
I've already looked into code base for function instantiation, and it doesn't check if return or argument types contain parametrized structs.
That unfortunately leads to the
EagerlyPopulateParametricEnvMap
missing struct inferred parameters.I' wonder if adding extra step in the
InstantiateParametricFunction
(typed_parametrics
) would fix this issue.
The text was updated successfully, but these errors were encountered: