Bug 15042 – [REG2.068] isInstanceOf fails when a template argument is an instance of the tested template

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-09-11T18:58:00Z
Last change time
2015-09-14T02:55:40Z
Assigned to
nobody
Creator
Marco.Leise

Comments

Comment #0 by Marco.Leise — 2015-09-11T18:58:11Z
I have a templated struct that emits an error when you pass in something else than "void" or another instance of itself. The following worked with 2.067, but fails with 2.068.1: ------------------------ import std.traits; struct RC(Parent) { static assert (is(Parent == void) || isInstanceOf!(RC, Parent), "This used to compile in 2.067"); } alias Regression = RC!(RC!(void)); ------------------------
Comment #1 by Marco.Leise — 2015-09-11T19:48:58Z
Comment #2 by dlang-bugzilla — 2015-09-11T19:53:12Z
(In reply to Marco Leise from comment #1) > Digger traced it down to this pull request for #14290: > https://github.com/D-Programming-Language/dmd/pull/4499/files#diff- > 0477a1d81a6a920c99362954179c59c8 Confirmed, introduced in https://github.com/D-Programming-Language/dmd/pull/4499
Comment #3 by k.hara.pg — 2015-09-14T02:55:40Z
(In reply to Marco Leise from comment #0) > I have a templated struct that emits an error when you pass in something > else than "void" or another instance of itself. The following worked with > 2.067, but fails with 2.068.1: > > ------------------------ > > import std.traits; > > struct RC(Parent) > { > static assert (is(Parent == void) || isInstanceOf!(RC, Parent), "This used > to compile in 2.067"); > } > > alias Regression = RC!(RC!(void)); > > ------------------------ (In reply to Vladimir Panteleev from comment #2) > Confirmed, introduced in > https://github.com/D-Programming-Language/dmd/pull/4499 This is an intentional change of PR#4499, which is necessary to kill ambiguity. And, it's a dup of issue 14756 already marked as invalid. I've wrote a descriptive comment for that. Please read it if you interest in the reason and the method to fix your code. https://issues.dlang.org/show_bug.cgi?id=14756#c1 *** This issue has been marked as a duplicate of issue 14756 ***