Skip to content

C#: calls bind to enum members of the same name (follow-up to #3795) #4245

Description

@ThatAblaze

Pre-flight checks

  • 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

  1. github-actions commented on Oct 8, 2026

    @github-actions

    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.

  2. safishamsi commented on Oct 9, 2026

    @safishamsi
    Member

    Fixed by #4254 (thanks @ayushcodes10), shipped in v0.9.83. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions