Skip to content

[TupleElementNames] Cannot be Emitted #214

@JasonBock

Description

@JasonBock

To reproduce:

public interface IUseTuples
{
  (nint Display, nuint Window)? X11 { get; }
}

var expectations = Rock.Create<IUseTuples>();

This will give errors like:

Error - Id: CS8138, Description: Rocks\Rocks.RockCreateGenerator\INativeWindow_Rock_Create.g.cs(57,5): error CS8138: Cannot reference 'System.Runtime.CompilerServices.TupleElementNamesAttribute' explicitly. Use the tuple syntax to define tuple names.

When a member uses a tuple, it emits a TupleElementNamesAttribute on the member. The mock types can't emit these.

This was found on Silk.NET.Core.Contexts.INativeWindow

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions