D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5017 - Access Violation when calling a template function of outer class (from inner one)
Summary: Access Violation when calling a template function of outer class (from inner ...
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2010-10-08 04:37 UTC by Koroskin Denis
Modified: 2014-08-31 13:49 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Koroskin Denis 2010-10-08 04:37:41 UTC
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.
Comment 1 yebblies 2014-08-31 13:49:36 UTC
I can't reproduce this with 2.067 HEAD