fix(卡② T7): config_db_cross_validator 引用闭合 5 行补类型标注过 S9 类型闸

trig_rows→Array[Variant]、dd/tr/c/do2→Dictionary[Variant,Variant](R1 无类型容器归零)。
config_db_test EXIT=0、counter_prefix_fatal EXIT=1(负向)、runtime 零转换错误。
This commit is contained in:
DKChan committed 2026-10-20 23:54:02 +08:00
1 parent a9d5ac13db
commit b42463c920
1 file changed
+5 -5
+5 -5
View File
@@ -113,7 +113,7 @@ func cross_validate(loaded: Dictionary, push_diag: Callable) -> void:
# 声明集 = feats + treasure 各行 triggers 内 kind=counter_add 的 do.counter_id;
# 读点 = when fact=counter 的 id、do.value_counter、kind=counter_spend 的 counter_id。
var feats_tab = loaded.get("feats")
var trig_rows: Array = []
var trig_rows: Array[Variant] = []
if feats_tab != null:
for r in feats_tab.rows:
trig_rows.append(r)
@@ -123,21 +123,21 @@ func cross_validate(loaded: Dictionary, push_diag: Callable) -> void:
var counter_decls := {}
for row in trig_rows:
for tr_v in (row.get("triggers", []) as Array):
var dd: Dictionary = (tr_v as Dictionary).get("do", {}) as Dictionary
var dd: Dictionary[Variant, Variant] = (tr_v as Dictionary).get("do", {}) as Dictionary[Variant, Variant]
# 声明集=任一 do.counter_id 行(counter_add 直写、forgive_seal_miss 经 _apply_counter_hit 写——皆写入行)
if dd.has("counter_id"):
counter_decls[String(dd.counter_id)] = true
for row in trig_rows:
var rid := String(row.get("feat_id", row.get("item_id", "")))
for tr_v in (row.get("triggers", []) as Array):
var tr: Dictionary = tr_v as Dictionary
var tr: Dictionary[Variant, Variant] = tr_v as Dictionary[Variant, Variant]
for c_v in (tr.get("when", []) as Array):
var c: Dictionary = c_v as Dictionary
var c: Dictionary[Variant, Variant] = c_v as Dictionary[Variant, Variant]
if String(c.get("fact", "")) == "counter" and c.has("id"):
var rd := String(c.id)
if not counter_decls.has(rd):
push_diag.call("error", "counter_dangling_ref", "%s when counter 读点无同名写入行: %s(引用闭合)" % [rid, rd])
var do2: Dictionary = tr.get("do", {}) as Dictionary
var do2: Dictionary[Variant, Variant] = tr.get("do", {}) as Dictionary[Variant, Variant]
if do2.has("value_counter") and not counter_decls.has(String(do2.value_counter)):
push_diag.call("error", "counter_dangling_ref", "%s value_counter 读点无同名写入行: %s" % [rid, String(do2.value_counter)])
if String(do2.get("kind", "")) == "counter_spend" and do2.has("counter_id") and not counter_decls.has(String(do2.counter_id)):