Bug in mixins?

Frustrated Frustrated at nowhere.com
Thu Mar 6 12:45:26 PST 2014


I have a mixin template that I use to make programming to 
interfaces easier. The problem is when I try to wrap the template 
to reduce dependence on the container class(using typeof(this)) I 
get an error as the string mixin is not working.

The code can be seen here

http://dpaste.dzfl.pl/6c90ca418996

The lines are 77-81 and 162-163 that are the problems. 
AbstractToInterface(a mixin template) simply wraps 
AbstractToInterface2(a string mixin)

(I haven't removed the container class dependency since it 
doesn't change anything yet but that is the goal)


I have a simplified test case that does work(and does remove the 
extra parameter but, again, that isn't where the problem is).

http://dpaste.dzfl.pl/dd8d1888da44

B is a string mixin template that depends on the container 
class(parameter T). I do not want to have to duplicate that 
argument though since it is not necessary. Hence where the mixin 
template C comes into play. It is able to get the container class 
type and pass it to B.

There is no real difference between the two yet the first gives 
strange errors(I get different errors about assignment(lines 200 
and 212) but dpaste gives more direct results(the properties to 
handle the general case are simply not mixed in).


There should be no difference between the two code examples. They 
both essentially do the same thing(wrap a string mixin). Why one 
works and the other doesn't is beyond me.... seems like a bug 
unless I'm doing something really stupid.

Any ideas?

P.S. The specific error I get is "Error: gui.border is not an 
lvalue" which suggests that the setter properties are not being 
inserted.




More information about the Digitalmars-d mailing list