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
{{ message }}
Repository navigation
C#: calls bind to enum members of the same name (follow-up to #3795) #4245
I have checked the Troubleshooting section in the README
What happened?
#3795 is fixed for type references: base types and parameter types no longer resolve to enum
members. Calls still do. Invoking a delegate-typed field gets a calls edge to an enum member
that shares the field's name.
Steps to reproduce
`Eval.cs`:
namespace Demo
{
public delegate float Curve(float t);
public class Eval
{
public enum Kind { Linear, Delegate }
public Kind Mode;
public Curve Delegate;
public float Evaluate(float t)
{
switch (Mode) { case Kind.Delegate: return Delegate != null ? Delegate(t) : t; default: return t; }
}
}
}
`graphify extract . --code-only`
Error output or graph output
### Actual
eval_demo_eval_evaluate --calls--> eval_demo_kind_delegate
`eval_demo_kind_delegate` is the enum member `Kind.Delegate`.
### Expected
No `calls` edge to `Kind.Delegate`. An enum member (or a property) can never be the target of a
call. `Delegate(t)` invokes the field; with no project method to point at, it gets no edge (or an
`unresolved_calls` entry).
Graphify version
0.9.80
Operating System
Windows
Python Version
3.13
Installation Method
pip
Additional Environment Details
No response
Additional context
In a ~120-file Unity project, 5 calls still land on enum members on 0.9.80. The other shapes
are inj.Handles[i].Pause() landing on an enum member Pause, and store.Vector2[idx] = new Vector2(...) (also Vector3, Quaternion) landing on enum members of
those names. Excluding enum members and properties from call-target lookup, as #3795 did for type
lookup, would cover all of them.
Activity
github-actions commentedon Oct 8, 2026
Thanks for opening this issue, @ThatAblaze. 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.
safishamsi commentedon Oct 9, 2026
Fixed by #4254 (thanks @ayushcodes10), shipped in v0.9.83. Closing.
fix(csharp): `new X()` never binds to a method that shares X's name