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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 8 16:27:05 UTC 2022


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

Paul Backus <snarwin+bugzilla at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |snarwin+bugzilla at gmail.com

--- Comment #3 from Paul Backus <snarwin+bugzilla at gmail.com> ---
Worth noting that even when immutable is stripped from the struct type itself,
it still applies to the struct's members:

---
immutable struct S { int n; }
static if (is(S : immutable U, U))
{
    static assert(!is(U == immutable));
    static assert(is(typeof(U.n) == immutable));
}
---

--


More information about the Digitalmars-d-bugs mailing list