mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:34:45 +01:00
Remove the special case for i32. (#4543)
For the few remaining uses of the builtin `i32` type, manually build an `IntType(Signed, 32)` value instead. These are: - The return type of `Run`. - The type that int literals in an `if` expression are converted into. - The type of an array index expression. We should consider converting those three cases away from `i32` over time. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
parent
b5368b3078
commit
e2ae5f212c
@@ -300,8 +300,7 @@ static auto BuildFunctionDecl(Context& context,
|
||||
!function_info.param_patterns_id.is_valid() ||
|
||||
!context.inst_blocks().Get(function_info.param_patterns_id).empty() ||
|
||||
(return_type_id.is_valid() &&
|
||||
return_type_id !=
|
||||
context.GetBuiltinType(SemIR::BuiltinInstKind::IntType) &&
|
||||
return_type_id != context.GetInt32Type() &&
|
||||
return_type_id != context.GetTupleType({}))) {
|
||||
CARBON_DIAGNOSTIC(InvalidMainRunSignature, Error,
|
||||
"invalid signature for `Main.Run` function; expected "
|
||||
|
||||
Reference in New Issue
Block a user