[Issue 19749] Inout causes wrong type inference

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 21 15:48:30 UTC 2019


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

--- Comment #6 from anonymous4 <dfj1esp02 at sneakemail.com> ---
If you want to preserve types, use inference:

struct S(T) {
    pragma(msg, T);
}

auto make(T)(T s) { return S!T(); }

pragma(msg, typeof(make("hi")));

prints
---
string
S!string
---

--


More information about the Digitalmars-d-bugs mailing list