www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - typdef causes access violation

--[test.d]--
typedef ulong[3] BBB;

template A() {
public:
	void foo(BBB a) {
		printf("A.foo\n");
		bar(a);
	}
}

struct B
{
private:
	mixin A!();

	void bar(BBB a) {
		printf("B.bar\n");
	}
}

void main() {
	ulong[3] aa;
	BBB a;
	B b;
	
	b.foo(a);
}

D:\D\src\build>dmd test.d
d:\D\dmd\bin\..\..\dm\bin\link.exe test,,,user32+kernel32/noi;

D:\D\src\build>test
A.foo
Error: Access Violation

If you replace BBB with ulong[3] in the 2 function calls and pass 'aa' 
instead of 'a' in main then it doesn't cause an access violation.

Regan

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jun 22 2004