Open jcasas00 opened 3 years ago
Right. This is a known issue. #387
Yes, same exact problem. The work-around using a local import should work but is limited to a fresh session (when the local import actually happens). Can possibly force a reload of the module at the top of the main function so it handles the case where the hcl.def_'ed function is used in multiple places as well.
Code:
Result: The above code generates a seg fault at the build stage. If the @hcl.def_ line is commented out, it works fine.
It is also okay if the whole findmax code with hcl.def is moved inside the maximum function (the example in the docs). This isn't ideal though as it restricts the ability to create modular blocks.