[Issue 12222] New: "alias this" ignored for aliased methods
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Feb 21 21:35:59 PST 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12222
Summary: "alias this" ignored for aliased methods
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P3
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: thecybershadow at gmail.com
--- Comment #0 from Vladimir Panteleev <thecybershadow at gmail.com> 2014-02-22 07:35:56 EET ---
///// test.d /////
struct S
{
void f() {}
}
struct W
{
S s;
alias s this;
alias f = s.f;
}
void main()
{
W w;
w.f();
}
//////////////////
Compiler complains:
test.d(16,2): Error: this for f needs to be type S not type W
However, there is an "alias this" it W to S which should allow the method to be
called with S as the "this" type.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list