D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2787 - Members found in an 'alias this' are not implicitly accessible in methods
Summary: Members found in an 'alias this' are not implicitly accessible in methods
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 All
: P2 normal
Assignee: No Owner
URL:
Keywords: patch, rejects-valid
: 6481 (view as issue list)
Depends on:
Blocks:
 
Reported: 2009-04-02 17:19 UTC by Jarrett Billingsley
Modified: 2015-06-09 01:18 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jarrett Billingsley 2009-04-02 17:19:21 UTC
struct Base
{
	int x;
	void foo() { writefln("%s", x); }
}

struct Derived
{
	Base _base;
	alias _base this;
	int y;
	void bar() { writefln("%s, %s", x, y); }  // line 16
}

foo.d(16): Error: undefined identifier x

But 'this.x' works.
Comment 1 Trass3r 2011-08-14 07:32:32 UTC
*** Issue 6481 has been marked as a duplicate of this issue. ***