You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Split out of #939 (review discussion) to keep that PR scoped to the parser bug in #935.
Problem
inheritors_of resolves the requested node, and when exact qualified-target lookup finds
nothing it falls back to the node's plain name. That fallback matches edges by bare
target plus source language, which does not establish namespace or package identity.
A/GenericBase.cs: namespace A; class GenericBase<T> {}
B/GenericBase.cs: namespace B; class GenericBase<T> {}
B/Child.cs: namespace B; class Child : GenericBase<string> {}
Querying the A declaration by its qualified graph name returns B.Child, with no
caveat attached:
Reproduces on main with plain class Child : PlainBase {} and two same-named PlainBase declarations. This is the bare-name fallback, not the generic handling.
Why it matters
#935 objected to the graph making unjustified affirmative claims about inheritance. A
false positive asserted without qualification is the same failure pointing the other way.
Options
Resolve the base name against namespace/package/import context before treating the
relationship as resolved — the real fix, and the one worth doing.
Attach a caveat when the fallback matched an ambiguous bare name, so the result is
returned but not asserted. A prototype existed in fix(parser): resolve generic inheritance targets #939 (restricting the ambiguity
count to Class/Type kinds) and was removed to keep that PR scoped.
Split out of #939 (review discussion) to keep that PR scoped to the parser bug in #935.
Problem
inheritors_ofresolves the requested node, and when exact qualified-target lookup findsnothing it falls back to the node's plain
name. That fallback matches edges by baretarget plus source language, which does not establish namespace or package identity.
Querying the
Adeclaration by its qualified graph name returnsB.Child, with nocaveat attached:
Not specific to generics
Reproduces on
mainwith plainclass Child : PlainBase {}and two same-namedPlainBasedeclarations. This is the bare-name fallback, not the generic handling.Why it matters
#935 objected to the graph making unjustified affirmative claims about inheritance. A
false positive asserted without qualification is the same failure pointing the other way.
Options
relationship as resolved — the real fix, and the one worth doing.
returned but not asserted. A prototype existed in fix(parser): resolve generic inheritance targets #939 (restricting the ambiguity
count to
Class/Typekinds) and was removed to keep that PR scoped.Option 2 is a mitigation; option 1 is the fix.