[Issue 20670] immutable template specialization pattern matches immutable struct, strips immutable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 7 14:28:11 UTC 2020


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

--- Comment #1 from FeepingCreature <default_357-line at yahoo.de> ---
Different instance of probably the same bug:

immutable struct Struct { }

struct Wrapper {
    void foo(U)(inout(U)) inout {
        // U is inferred as 'struct Struct', not 'immutable struct Struct'.
        // evidence:
        pragma(msg, isMutable!Struct.stringof ~ " - " ~ isMutable!U.stringof);
        static assert(is(U == Struct));
    }
}

Wrapper().foo(Struct());

--


More information about the Digitalmars-d-bugs mailing list