Comment #0 by jlourenco5691 — 2022-05-06T12:08:46Z
The member function returns a ref instead of an lvalue.
```
struct Foo
{
auto ref get() { return i; }
int i;
}
auto ref get()(auto ref Foo foo) { return foo.i; }
void main()
{
static assert(!__traits(compiles, &get(Foo(4)))); // ok
static assert(!__traits(compiles, &Foo(4).get())); // fails
}
```
This probably happens because this bit of code does not fail also
```
struct Foo
{
ref get() { return i; }
int i;
}
void main()
{
auto p = &Foo(4).get;
}
```
Comment #1 by robert.schadek — 2024-12-13T19:22:41Z