Bug 5017 – Access Violation when calling a template function of outer class (from inner one)
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-10-08T04:37:00Z
Last change time
2014-08-31T13:49:36Z
Keywords
wrong-code
Assigned to
nobody
Creator
2korden
Comments
Comment #0 by 2korden — 2010-10-08T04:37:41Z
Test case:
class A
{
class B
{
void bar()
{
return foo!(int)();
}
}
int foo(T)()
{
return 42;
}
this()
{
b = new B();
}
B b;
}
void main()
{
A a = new A();
a.b.bar();
}
I think the problem is that prior to calling A.foo!(int) it tries to execute an A.invariant(), but `this' pointer is null for some reason.