D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7278 - Templated struct (instantiated with null) can't access its own members (DMD confused about struct's type)
Summary: Templated struct (instantiated with null) can't access its own members (DMD c...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: patch, rejects-valid
Depends on:
Blocks:
 
Reported: 2012-01-12 00:49 UTC by Nick Sabalausky
Modified: 2012-01-15 23:21 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 Nick Sabalausky 2012-01-12 00:49:37 UTC
struct Foo(string s)
{
	string var;
	void func()
	{
		string local = var;
	}
}

Foo!null a;
Foo!null b;

---------------------------
Result:
test.d(6): Error: this for var needs to be type Foo not type Foo!(null)
---------------------------

Both 'a' and 'b' need to be there to trigger this bug.