www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22254] New: Template instanted twice results in different

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 puremagic.com
          Reporter: default_357-line 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.

--
Aug 29 2021