Thread overview
Algebraic template instance holder
Feb 10, 2016
Voitech
Feb 10, 2016
ZombineDev
Feb 12, 2016
Voitech
February 10, 2016
Hi, why this is not working ?


class Base{
	int a;
}

class BaseTemplate(E):Base{
	E value;
	this(E value){
		this.value=value;
	}
}

class Concrete:BaseTemplate!int{
	this(int value){
		super(value);
	}
}
unittest{
	Algebraic!(Concrete) holder;
	Concrete a=new Concrete(4);
	holder =Algebraic!Concrete(a);
}
February 10, 2016
On Wednesday, 10 February 2016 at 10:31:34 UTC, Voitech wrote:
> Hi, why this is not working ?
>
>
> class Base{
> 	int a;
> }
>
> class BaseTemplate(E):Base{
> 	E value;
> 	this(E value){
> 		this.value=value;
> 	}
> }
>
> class Concrete:BaseTemplate!int{
> 	this(int value){
> 		super(value);
> 	}
> }
> unittest{
> 	Algebraic!(Concrete) holder;
> 	Concrete a=new Concrete(4);
> 	holder =Algebraic!Concrete(a);
> }

This is a bug. I filled it as: https://issues.dlang.org/show_bug.cgi?id=15670

I will see if I can fix it tomorrow.
February 12, 2016
On Wednesday, 10 February 2016 at 20:53:15 UTC, ZombineDev wrote:
> On Wednesday, 10 February 2016 at 10:31:34 UTC, Voitech wrote:
>> Hi, why this is not working ?
>>
>>
>> class Base{
>> 	int a;
>> }
>>
>> class BaseTemplate(E):Base{
>> 	E value;
>> 	this(E value){
>> 		this.value=value;
>> 	}
>> }
>>
>> class Concrete:BaseTemplate!int{
>> 	this(int value){
>> 		super(value);
>> 	}
>> }
>> unittest{
>> 	Algebraic!(Concrete) holder;
>> 	Concrete a=new Concrete(4);
>> 	holder =Algebraic!Concrete(a);
>> }
>
> This is a bug. I filled it as: https://issues.dlang.org/show_bug.cgi?id=15670
>
> I will see if I can fix it tomorrow.

Hi @ZombineDev have you by chance looked at this bug ?