Bug in D!!!

lobo via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 30 14:41:44 PDT 2017


On Wednesday, 30 August 2017 at 20:47:12 UTC, EntangledQuanta 
wrote:
> 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?

Knock yourself out:

https://issues.dlang.org/

Anyone can open tickets for bugs or enhancement requsts.

bye,
lobo


More information about the Digitalmars-d-learn mailing list