Skip to content

[Bug]: C#: a call on Type.Instance (static property of its own type) gets no calls edge and no unresolved_calls entry #5376

Open

Description

@avi-xpressiv

What happened?

Singletons reached through a static property are the usual way Unity code calls its managers (AudioManager.Instance.Play()). graphify resolves a call through a typed field, but drops the same call through a static property: no calls edge, and nothing in the caller's metadata.unresolved_calls. In one Unity project (about 2,000 C# files) this is roughly 1,170 call sites, so a call trace stops at the first manager.

Expected calls edges: all four methods below -> Audio.Click().
Actual (graphifyy 0.9.114): only Menu.ViaField() -> Audio.Click(). The other three methods have no calls edge and no unresolved_calls entry.

Reproduction

GRAPHIFY_BACKEND=none graphify extract . --code-only

// src/Audio.cs
public class Audio
{
    public static Audio Instance { get; private set; }
    public void Click() { }
}

// src/Menu.cs
public class Menu
{
    private Audio audio;

    public void ViaInstance() { Audio.Instance.Click(); }
    public void ViaConditional() { Audio.Instance?.Click(); }
    public void ViaLocal() { var a = Audio.Instance; a.Click(); }
    public void ViaField() { audio.Click(); }
}

Suggested rule

When the receiver is T.P (or T.P?.) and P is a static property or field declared on T with declared type T, treat the receiver type as T; the same for a var local initialised from T.P. EXTRACTED when P's declared type is read from the declaration, otherwise INFERRED.

Possibly related: #3538 (member access to the receiver type's property), #3120 (property/field reads), #2041 (dotted calls).

Environment

graphifyy 0.9.114, Python 3.13, macOS; checked the README Troubleshooting section.

Activity

  1. github-actions commented on Nov 21, 2026

    @github-actions

    Thanks for opening this issue, @avi-xpressiv. 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.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions