Repository navigation
fix: Compile and lower comptime functions with fully qualified names - #2517
Conversation
maximilianruesch
left a comment
There was a problem hiding this comment.
Nice PR, just want to get the tests in the right place!
There was a problem hiding this comment.
There is no reason this needs to be a top level file, especially since this is doing some integration / end-to-end testing. Please move these tests to the existing tests.integration.test_link_name module. You should be able to reuse some functions (such as the function name extractor) from there.
There was a problem hiding this comment.
Moved the four comptime name tests into tests.integration.test_link_name, reused _func_names and the qualifier fixture, and removed the top-level file and its duplicate extractor. The production fix is unchanged. The 17 link-name tests pass, and the four moved regressions still fail without the production fix.
maximilianruesch
left a comment
There was a problem hiding this comment.
🚀
Thanks for this!
Fixes #2319.
Use the existing qualified function-name and monomorphization helpers when compiling comptime functions, matching ordinary Guppy functions. This replaces generated names such as
__hugr__.panicking_func.7in panic traces withstack_traces.comptime.panicking_func.Keep type and constant instantiations distinct with the existing monomorphized-name format. Add four tests for qualified names, type and constant instantiations, and same-named functions in different scopes. Update the existing comptime panic-trace snapshot; source file and line metadata are unchanged.
Local validation on Linux / CPython 3.13.17:
This is local validation, not a clean full-suite or remote-CI result. Notebook tests were not completed. Investigation, patch and tests were AI-assisted; independent human review is pending.