www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Possible forward reference bug?

reply Benjamin Thaut <code benjamin-thaut.de> writes:
The following code will trigger the static assertion:

class Base(T)
{
   static assert(is(T : Base!T), "not related");
}

class Derived : Base!Derived
{
}


Could this be a forward reference bug? Because Derived is derived from 
Base!Dervived, so the is expression should return true.

Kind Regards
Benjamin Thaut
Feb 04 2014
parent Timon Gehr <timon.gehr gmx.ch> writes:
On 02/04/2014 08:46 PM, Benjamin Thaut wrote:
 The following code will trigger the static assertion:

 class Base(T)
 {
    static assert(is(T : Base!T), "not related");
 }

 class Derived : Base!Derived
 {
 }


 Could this be a forward reference bug? Because Derived is derived from
 Base!Dervived, so the is expression should return true.

 Kind Regards
 Benjamin Thaut
Yes, this is indeed a forward reference bug.
Feb 04 2014