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));
------------------------
(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 ***