Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std.typecons.Tuple does not support compatible .tupleof args #10569

Open
dlangBugzillaToGithub opened this issue Nov 27, 2024 · 0 comments
Open

Comments

@dlangBugzillaToGithub
Copy link

b2.temp reported this on 2024-11-27T04:40:10Z

Transfered from https://issues.dlang.org/show_bug.cgi?id=24886

CC List

Description

In the following code, calls to f2 are all rejected. That is a  bit weird.

```
import std;

struct S
{
    uint a;
    uint b;
}

void f1(uint a, uint b){}
void f2(Tuple!(uint, uint) a){}

void main()
{
    S s;
    uint[2] a;

    f1(s.tupleof); // OK
    f1(a.tupleof); // OK

    f2(s.tupleof); // NG
    f2(a.tupleof); // NG
}  
```

The reason for that is obviously that D does not do implict construction. In case D got first class citizen tuples this would have to work.
@LightBender LightBender removed the P1 label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants