Repository navigation
Description
Pre-flight checks
- I have checked the Troubleshooting section in the README
What happened?
Follow-up to #4570 / #4573, as suggested in the PR discussion. With #4573 (0fcda3a129), a VB.NET call through a parameter or a typed local gets its calls edge. A call through a field, or through a With block, still gets none. #4573 records both as expected-failure tests (field; With on a local).
In WinForms-style VB these are the usual shapes. A form holds its collaborators in fields, often initialised in the declaration or declared in the other half of a partial class (Form1.Designer.vb), and uses With blocks on them. So in a form most outgoing calls to other classes have no edge, and affected / path miss those callers.
This repro covers the shapes beyond the two in #4573's tests, one method per case:
- F1: field initialised in its declaration (
As New) - F2: field assigned in
Sub New - F3:
Me._field.Method() - F4: field typed as a C# class
- F5: field declared in the other partial file (
OrderForm.Designer.vb) - W1–W4:
Withon a field, a typed local,New Repository(), and a C#-typed field - P1: parameter (control, already resolved by fix(vbnet): resolve cross-file calls to Module members, typed locals and C# statics (#4570) #4573)
Expected: a calls edge for each case. In each, the receiver's type is declared in the same statement or field declaration and names exactly one type in the corpus. The C# equivalent, private Store _store = new Store(); then _store.Save(), does get an edge.
Steps to reproduce
Four files in one folder:
`Repository.vb`
Public Class Repository
Public Sub Load(id As Integer)
End Sub
Public Sub Save()
End Sub
End Class
`PriceRules.cs`
namespace Shop.Rules
{
public class PriceRules
{
public decimal Total(int id) { return 0m; }
}
}
`OrderForm.Designer.vb`
Partial Class OrderForm
Inherits System.Windows.Forms.Form
Friend Archive As New Repository()
End Class
`OrderForm.vb`
Partial Class OrderForm
Private _repository As New Repository()
Private _rules As New Shop.Rules.PriceRules()
Private _late As Repository
Public Sub New()
_late = New Repository()
End Sub
Public Sub F1_FieldNew()
_repository.Load(1)
End Sub
Public Sub F2_FieldAssignedLater()
_late.Save()
End Sub
Public Sub F3_MeField()
Me._repository.Save()
End Sub
Public Sub F4_FieldCSharp()
_rules.Total(1)
End Sub
Public Sub F5_FieldInOtherPartialFile()
Archive.Save()
End Sub
Public Sub W1_WithField()
With _repository
.Load(2)
End With
End Sub
Public Sub W2_WithLocal()
Dim r As New Repository()
With r
.Save()
End With
End Sub
Public Sub W3_WithNew()
With New Repository()
.Load(3)
End With
End Sub
Public Sub W4_WithFieldCSharp()
With _rules
.Total(2)
End With
End Sub
Public Sub P1_Parameter(x As Repository)
x.Save()
End Sub
End Class
GRAPHIFY_BACKEND=none graphify extract fields-repro --code-only
`graphify explain` on each case method shows whether it has an outgoing `calls` edge:
graphify explain "F1_FieldNew()" --graph fields-repro/graphify-out/graph.json # only the <-- OrderForm [method] edge
graphify explain "P1_Parameter()" --graph fields-repro/graphify-out/graph.json # --> Save() [calls] [INFERRED]Error output or graph output
MISSING F1_ -> Load
MISSING F2_ -> Save
MISSING F3_ -> Save
MISSING F4_ -> Total
MISSING F5_ -> Save
MISSING W1_ -> Load
MISSING W2_ -> Save
MISSING W3_ -> Load
MISSING W4_ -> Total
FOUND P1_ -> Save
Graphify version
0.9.92
Operating System
Windows
Python Version
3.13
Installation Method
uv tool install (recommended)
Additional Environment Details
GRAPHIFY_BACKEND=none, --code-only; no provider API keys set. Reproduced in a fresh folder that contains only the four files above. Output above is from the #4573 branch (0fcda3a129); on 0.9.92 from PyPI all ten cases are MISSING, including P1.
Additional context
- Related: [Bug]: vbnet: cross-file and VB -> C# calls produce no calls edges (Module functions, typed locals, C# statics) #4570, fix(vbnet): resolve cross-file calls to Module members, typed locals and C# statics (#4570) #4573 (expected-failure tests
test_probe_a_call_through_a_field_or_parameter_typed_as_the_class_reaches_its_method[field]andtest_probe_a_member_call_inside_a_with_block_reaches_the_with_objects_method).
Activity
github-actions commentedon Oct 20, 2026
Thanks for opening this issue, @TerraVenil. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
Deepjyoti-Sarmah commentedon Oct 20, 2026
Thanks for the repro. It reproduces on the #4573 branch exactly as reported, and I'll take this one.
Each case is lost in one of two places:
_field.Method()): the extractor records the call, but the receiver goes out as a plain name with no type, because only locals and parameters have aname -> declared typetable. The resolver tries the name as a type or Module, finds it's a field (hidden_by_member) and gives up. The field nodes don't carry their declared type either, so there would be nothing to look up.Me._repositorycounts as an expression of unknown type. A.Load()call has no receiver in its own text, and the extractor doesn't trackWithblocks. That drop is deliberate: on v8, a.Save()insideWithbound to the caller's ownSavewhen the caller had one.Plan:
As T,As New T(),= New T()) on the field node. The resolver looks fields up per class, across partial files and base classes, after locals and parameters. That covers F1-F5, includingArchivein the Designer file.Withtargets while walking a method, so.Load()becomes a call on the innermost target (a field, a typed local, orNew T()). A target of unknown type, likeWith GetThing(), still gets no edge._vbnet_resolvedmarker from 0fcda3a.Before writing the fix I'll check these against the compiler:
As: I expectPrivate x = New Repository()to beObject, since Option Infer doesn't cover fields, which means no edgeWithblocksWithEvents Button1 As Button: no edge and no stubThe fix will be a separate PR on top of #4573.
test(vbnet): calls through fields, Me.field and With blocks (Graphify…
fix(vbnet): resolve calls through typed fields, Me.field and With blo…
test(vbnet): expect C# field callees under their owner-qualified labe…
test(vbnet): calls through fields, Me.field and With blocks (Graphify…
fix(vbnet): resolve calls through typed fields, Me.field and With blo…
test(vbnet): expect C# field callees under their owner-qualified labe…
test(vbnet): calls through fields, Me.field and With blocks (Graphify…
fix(vbnet): resolve calls through typed fields, Me.field and With blo…
test(vbnet): expect C# field callees under their owner-qualified labe…