refactor(mir): Phase 139-P3-B - RoutingDecision を enum 対応 + レガシー削除

- RoutingDecision の missing_caps を Vec<CapabilityTag> に変更(型安全化)
- error_tags は to_tag() メソッドで自動生成
- 全 callsite を enum variant に修正
- capability_tags モジュール(文字列定数群)を完全削除
- 全テスト PASS(型安全性向上を確認)
- フォーマット適用
This commit is contained in:
nyash-codex
2025-12-16 07:02:14 +09:00
parent 146f14a019
commit e404746612
106 changed files with 1475 additions and 1017 deletions

View File

@ -149,7 +149,8 @@ impl super::MirBuilder {
// Second pass: update any user variables that pointed to old pin ids to the new ones
if !pin_renames.is_empty() {
let snapshot: Vec<(String, super::ValueId)> = self
.variable_ctx.variable_map
.variable_ctx
.variable_map
.iter()
.filter(|(k, _)| !k.starts_with("__pin$"))
.map(|(k, &v)| (k.clone(), v))
@ -316,7 +317,8 @@ impl super::MirBuilder {
effects,
})?;
if let Some(d) = dst {
let mut recv_box: Option<String> = self.type_ctx.value_origin_newbox.get(&box_val).cloned();
let mut recv_box: Option<String> =
self.type_ctx.value_origin_newbox.get(&box_val).cloned();
if recv_box.is_none() {
if let Some(t) = self.type_ctx.value_types.get(&box_val) {
match t {
@ -327,7 +329,11 @@ impl super::MirBuilder {
}
}
if let Some(bt) = recv_box {
if let Some(mt) = self.comp_ctx.plugin_method_sigs.get(&(bt.clone(), method.clone())) {
if let Some(mt) = self
.comp_ctx
.plugin_method_sigs
.get(&(bt.clone(), method.clone()))
{
self.type_ctx.value_types.insert(d, mt.clone());
} else {
// Phase 84-4-B: ビルトイン Box のメソッド戻り値型推論
@ -489,7 +495,8 @@ impl super::MirBuilder {
dst: super::ValueId,
src: super::ValueId,
) -> Result<(), String> {
if let (Some(ref mut function), Some(bb)) = (&mut self.scope_ctx.current_function, self.current_block)
if let (Some(ref mut function), Some(bb)) =
(&mut self.scope_ctx.current_function, self.current_block)
{
if std::env::var("NYASH_SCHEDULE_TRACE").ok().as_deref() == Some("1") {
eprintln!(