소스 검색

Better diagnostic message in CHECK (#5504)

Geoff Romer 11 달 전
부모
커밋
515eb6b45b
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      toolchain/check/pattern_match.cpp

+ 2 - 1
toolchain/check/pattern_match.cpp

@@ -303,7 +303,8 @@ auto MatchContext::DoEmitPatternMatch(Context& context,
       break;
     }
     case MatchKind::Callee: {
-      CARBON_CHECK(!param_pattern.index.has_value());
+      CARBON_CHECK(!param_pattern.index.has_value(),
+                   "ValueParamPattern index set before callee pattern match");
       param_pattern.index = NextRuntimeIndex();
       ReplaceInstBeforeConstantUse(context, entry.pattern_id, param_pattern);
       auto param_id = AddInst<SemIR::ValueParam>(