Bug in D!!!

EntangledQuanta via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 30 13:47:12 PDT 2017


This is quite surprising!

public struct S(T)
{
	T s;
}


interface I
{	
	void Go(T)(S!T s);

	static final I New()
	{
		return new C();
	}
}

abstract class A : I
{
	
}


class C : A
{
	void Go(T)(S!T s)
	{
		
	}
}


void main()
{
	S!int s;
	auto c = I.New();
	
	c.Go(s);    // fails!
	//(cast(C)c).Go(s);  // Works, only difference is we have made c 
an explicit C.
	
}

https://dpaste.dzfl.pl/dbc5a0663802

Everything works when Go is not templatized(we explicitly make T 
an int)


This is a blocker for me! Can someone open a ticket?





More information about the Digitalmars-d-learn mailing list