mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
When performing deduction for a call to a generic function, we would previously convert runtime arguments to match the parameter type, then throw away the result. Instead, track whether deduction needs the value of the argument, which will be the case only within compile-time contexts such as generic bindings and types of instructions, and only perform conversions during deduction for those contexts. Fixes miscompiles when passing an argument requiring a runtime conversion with side-effects to a generic function, where previously the side-effects would have happened twice! (Once from deduction and once from the real call argument conversion.) Assisted-by: Gemini via Antigravity