Skip to content

Issue with tuples and unmanaged constraint #32103

@jcouv

Description

@jcouv

https://stackoverflow.com/questions/53992855/how-do-a-struct-containing-valuetuple-can-satisfy-unmanaged-constraint-but-valu

class Program
{
    static void DoSomething<T>() where T : unmanaged { }
    struct MyStruct {  public (int, int) Value; }
    static void Main(string[] args)
    {
        DoSomething<MyStruct>();    // → OK
        DoSomething<(int, int)>();  // → Shows compile-time error
    }
}

Reported by @johnkellyoxford

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions