Problem: When compiling nested functions as module-level private functions, the codegen iterates over both:
- Global functions from
program.functions
- Nested functions from each function's
sym_table.functions
This causes potential naming collisions if a nested function has the same name as a global function or another nested function.
Root cause: MLIR's func.func has the IsolatedFromAbove trait, which prevents true nested function nesting (functions can't capture parent scope). Current workaround makes nested functions module-level private, losing the namespacing.
Problem: When compiling nested functions as module-level
privatefunctions, the codegen iterates over both:program.functionssym_table.functionsThis causes potential naming collisions if a nested function has the same name as a global function or another nested function.
Root cause: MLIR's
func.funchas theIsolatedFromAbovetrait, which prevents true nested function nesting (functions can't capture parent scope). Current workaround makes nested functions module-level private, losing the namespacing.