docs← Back to article

Markdown for LLMs

dangling-const-ref

The source Markdown for this article. Copy it into your assistant or download it as a text file.

Download this articlePlain text ↗
# dangling-const-ref

Выводящий узел ссылается const_ref-ом на id в СВОЁМ пространстве имён, которого нет ни среди узлов, ни среди членов перечислений пакета — голый член чужого перечисления резолвится локально; check и lower молчат, TYPE_ERROR приходит на исполнении.

## Query

```lawq
from n in nodes
where n.kind in ["rule", "constraint", "closure_policy", "priority_rule"]
  and exists(k in fields
             where (k.node == n.id and ends_with(k.field, ".kind") and k.value == "const_ref"))
  and exists(f in fields
             where (f.node == n.id
                    and ends_with(f.field, ".id")
                    and contains(f.value, "#")
                    and starts_with(f.value, n.package)
                    and not exists(m in nodes where (m.id == f.value))
                    and not exists(v in fields
                                   where (v.value == short(f.value)
                                          and v.package == n.package
                                          and starts_with(v.field, "variants")))))
select n.id as node, anchor(n.id) as anchors
```