Commit b7bf771f
b7bf771f317cMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 1 file · ~1 modified
Description
fix(analyze): warn on non-convergence after fixpoint cap (#806)
The param-array type inference fixpoint runs at most 4 iterations and exits silently. If the program's inter-procedural type dependencies need more iterations, types stay widened beyond what a converged fixpoint would have produced -- and the user has no signal that this happened.
Emit a stderr warning when the loop exits with changed == 1 (the last iteration still mutated state and would have run again). The 4-iter cap is preserved -- raising it would risk compile-time explosions on adversarial inputs. The warning at least surfaces the divergence so the user knows where to look.
Closes #806
Co-Authored-By: Claude Opus 4.7 [email protected]
Details
- Commit
- b7bf771f317c
- Parent
- 710cbe2a7b80
spinel_analyze.rbmodifiedView file
end @current_class_idx = -1 end # Issue #806: warn on non-convergence after the cap. changed == 1 # means the last iteration still mutated state and would have run # again. Indicates types may remain widened beyond what a converged # fixpoint would have produced. if changed == 1 $stderr.puts "warning: param-array type inference did not converge after 4 iterations; some types may be widened to poly" end end # Body-side param narrowing (Stage 1 of the callee→caller direction