瀏覽代碼

Simplify type check. (#7155)

Assisted-by: Gemini via Antigravity
Richard Smith 1 天之前
父節點
當前提交
ab409a6a71
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      toolchain/check/handle_if_expr.cpp

+ 2 - 3
toolchain/check/handle_if_expr.cpp

@@ -37,9 +37,8 @@ auto HandleParseNode(Context& context, Parse::IfExprIfId node_id) -> bool {
 static auto DecayIntLiteralToSizedInt(Context& context, Parse::NodeId node_id,
                                       SemIR::InstId operand_id)
     -> SemIR::InstId {
-  if (context.types().GetTypeInstId(
-          context.insts().Get(operand_id).type_id()) ==
-      SemIR::IntLiteralType::TypeInstId) {
+  if (context.types().Is<SemIR::IntLiteralType>(
+          context.insts().Get(operand_id).type_id())) {
     operand_id = ConvertToValueOfType(
         context, node_id, operand_id,
         MakeIntType(context, node_id, SemIR::IntKind::Signed,