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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Sep 13 19:55:40 PDT 2015


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

Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #3 from Kenji Hara <k.hara.pg at gmail.com> ---
(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 ***

--


More information about the Digitalmars-d-bugs mailing list