You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
///// 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.
The text was updated successfully, but these errors were encountered:
Vladimir Panteleev (@CyberShadow) reported this on 2014-02-21T21:35:56Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=12222
CC List
Description
///// 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.The text was updated successfully, but these errors were encountered: