[Issue 22254] New: Template instanted twice results in different immutable qualifier

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 30 06:38:26 UTC 2021


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

          Issue ID: 22254
           Summary: Template instanted twice results in different
                    immutable qualifier
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: default_357-line at yahoo.de

Consider the following code:

struct Template(T) { T t; }

Template!Bar a;
Template!Bar b;

immutable struct Bar { }

pragma(msg, typeof(a).stringof);
pragma(msg, typeof(b).stringof);

static assert(is(typeof(a) == typeof(b)));

Since 2.076.1, this assert fails, because it instantiates Template once with
"Bar" and once with "immutable Bar".

What the heck.

--


More information about the Digitalmars-d-bugs mailing list