mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
When an `IntLiteral` appears as an operand of an `if` expression, convert it to `i32` for now, so that we don't reject things like `if cond then 1 else 2` due to having a non-constant value of type `IntLiteral`. For tuple indexing expressions such as `(a, b).0`, convert the index to type `IntLiteral`, not to type `i32`. This isn't strictly necessary to do in this PR, but avoids the need to provide an `IntLiteral` -> `i32` implicit conversion for `no_prelude` tests using this syntax.