mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 10:54:49 +01:00
Represent integer literals as IntLiteral not as i32. (#4532)
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.
This commit is contained in:
@@ -29,10 +29,6 @@ constexpr DiagnosticKind UntestedDiagnosticKinds[] = {
|
||||
DiagnosticKind::ErrorStattingFile,
|
||||
DiagnosticKind::FileTooLarge,
|
||||
|
||||
// Int literals are currently limited to i32. Once that's fixed, this
|
||||
// should be tested.
|
||||
DiagnosticKind::ArrayBoundTooLarge,
|
||||
|
||||
// These aren't feasible to test with a normal testcase, but are tested in
|
||||
// lex/tokenized_buffer_test.cpp.
|
||||
DiagnosticKind::TooManyTokens,
|
||||
|
||||
Reference in New Issue
Block a user