Summary
Python: a parameter annotated with a string (forward-reference) annotation — def f(o: "Alpha") — loses receiver-type resolution that the identical unquoted annotation gets. The method call produces no calls edge at all.
Quoted annotations are ordinary Python (forward references, and everything under from __future__ import annotations), so this silently drops real edges in normal code.
Environment
@colbymchenry/codegraph 1.5.0 and 1.6.0 (npm latest), Linux, fresh codegraph init per version.
Repro
# pkg/a.py
def render(x):
return x
class Alpha:
def render(self):
return "a"
class Beta:
def render(self):
return "b"
# pkg/b.py
from .a import Alpha
def quoted(o: "Alpha"):
return o.render() # -> NO EDGE
def bare(o: Alpha):
return o.render() # -> calls Alpha.render (pkg/a.py:6)
Observed — identical on 1.5.0 and 1.6.0
caller target line
bare render @pkg/a.py:6 9
(quoted produces no row at all)
Same file, same call expression, same class — only the quoting of the annotation differs.
Note on the trigger
The miss needs a competing same-named method to be present: with only Alpha.render (plus the top-level render) in the tree, the quoted form still resolved. Adding Beta.render is what makes the quoted form drop out while the bare form keeps resolving. So the quoted annotation appears not to establish the receiver type, leaving the call to name matching, which then declines under the extra candidate.
codegraph callers render correspondingly under-reports: quoted never appears.
Verification
Reproduced on both versions with a fresh index each time. Controls in the same run: the unquoted form resolves, and in a two-candidate variant of the same fixture the quoted form resolves — so this is the quoting interacting with candidate count, not a blanket annotation failure.
Summary
Python: a parameter annotated with a string (forward-reference) annotation —
def f(o: "Alpha")— loses receiver-type resolution that the identical unquoted annotation gets. The method call produces nocallsedge at all.Quoted annotations are ordinary Python (forward references, and everything under
from __future__ import annotations), so this silently drops real edges in normal code.Environment
@colbymchenry/codegraph1.5.0 and 1.6.0 (npm latest), Linux, freshcodegraph initper version.Repro
Observed — identical on 1.5.0 and 1.6.0
Same file, same call expression, same class — only the quoting of the annotation differs.
Note on the trigger
The miss needs a competing same-named method to be present: with only
Alpha.render(plus the top-levelrender) in the tree, the quoted form still resolved. AddingBeta.renderis what makes the quoted form drop out while the bare form keeps resolving. So the quoted annotation appears not to establish the receiver type, leaving the call to name matching, which then declines under the extra candidate.codegraph callers rendercorrespondingly under-reports:quotednever appears.Verification
Reproduced on both versions with a fresh index each time. Controls in the same run: the unquoted form resolves, and in a two-candidate variant of the same fixture the quoted form resolves — so this is the quoting interacting with candidate count, not a blanket annotation failure.