www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - bug: mixin and classes

Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

OS: Windows 7RC
Compiler: DMD v2.030
Library: Phobos2

Attached file is Cris Miller's template implementation of a circular 
list download today from dprogramming.com. Note that changing the order 
of declaration for the two classes produces a slightly different error 
message, but the problem remains the same. Additionally, removing the 
LM2Asset class allows the code to compile correctly.

private import list;

void main()
{
	UIC.ListHead uicList;

	foreach (n; 0 .. 10)
	{
     		uicList ~= new UIC();
	}

}

// comment out LM2Asset and this compiles correctly
class LM2Asset
{
	mixin List;
}

class UIC
{
	mixin List;
}
Jul 02 2009