Bug 22254 – Template instantiated twice results in different immutable qualifier

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2021-08-30T06:38:26Z
Last change time
2021-11-19T20:28:37Z
Keywords
pull
Assigned to
No Owner
Creator
FeepingCreature

Comments

Comment #0 by default_357-line — 2021-08-30T06:38:26Z
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.
Comment #1 by dlang-bot — 2021-11-19T05:26:10Z
@BorisCarvajal created dlang/dmd pull request #13321 "Fix Issue 22254 - Template instantiated twice results in different immutable qualifier" fixing this issue: - Fix Issue 22254 - Template instantiated twice results in different immutable qualifier https://github.com/dlang/dmd/pull/13321
Comment #2 by dlang-bot — 2021-11-19T20:28:37Z
dlang/dmd pull request #13321 "Fix Issue 22254 - Template instantiated twice results in different immutable qualifier" was merged into master: - 78b0ca95209ac2cffcf893dc1c80102dd116a81e by Boris Carvajal: Fix Issue 22254 - Template instantiated twice results in different immutable qualifier https://github.com/dlang/dmd/pull/13321