[Issue 22873] Wrong std.format output for `inout`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 11 18:03:45 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=22873

--- Comment #1 from johanengelen at weka.io ---
I've tried to simplify the issue with `inout`:
```
struct U8  {  }

enum canCreateVariable(T) = __traits(compiles, { T val; });

struct ContainsU8 {
    U8 text;
    auto withInout() inout {
        foo(text);
    }
    auto normal() {
        foo(text);
    }
}

void foo(T)(T obj)
{
    pragma(msg, T);
    pragma(msg, canCreateVariable!T);
}

void main() {
    ContainsU8 a;
}
```
Outputs:
inout(U8)
false
U8
true

--


More information about the Digitalmars-d-bugs mailing list