www.digitalmars.com         C & C++   DMDScript  

D - Bug DMD 0.74: typedefs in templates

It seems like the following should work.


template TFoo(T)
{
	class Foo
	{
		typedef T FooType;
	}
}

template TBar(T)
{
	class Bar
	{
		T.FooType a;
	}
}

alias instance TFoo(int).Foo IntFoo;

// This generates no property 'FooType' for type 'Foo'
alias instance TBar(IntFoo) IntFooBar;

int main(char[][] argv)
{
	// However here it works ok
	IntFoo.FooType a;

	return 0;
}
Oct 21 2003