Skip to content

[Bug]: C#: named tuple element names are emitted as type references #3796

Closed

Description

@ThatAblaze

What happened?

The element NAMES of a named tuple type are treated as type names.

Steps to reproduce

Repro — `Reader.cs`:

namespace Demo
{
    public class Reader
    {
        public static (int mode, string label) Read() => (1, "a");
    }
}

Error output or graph output

Actual:

reader_demo_reader_read --references--> mode   (return_type)
reader_demo_reader_read --references--> label  (return_type)

with `mode` and `label` minted as location-less placeholder nodes.

Expected: no references for `mode` / `label` (they are element names; the element TYPES are
`int` and `string`). In tree-sitter-c-sharp the tuple element is a `tuple_element` with `type` and
`name` fields; only the `type` field should feed type-reference collection.

Impact: one 5-element tuple return in our codebase produced five junk "type" nodes, repeated in
every file that declares such a signature.

Graphify version

No response

Environment

graphify 0.9.67 (pip graphifyy), Python 3.13.1, Windows 10 (10.0.19045)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions