Bug 7945 – alias this doesn't work on function ref parameter

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-19T06:36:00Z
Last change time
2012-05-20T23:46:01Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2012-04-19T06:36:22Z
The four calls should work, but #1 doesn't work. struct S { int v; alias v this; } void foo(ref int n){} void main() { auto s = S(1); // variable s is lvalue, so // alias this expanded expression s.v is also lvalue and matches to ref. foo(s); // 1.NG -> OK s.foo(); // 2.OK, ufcs foo(s.v); // 3.OK s.v.foo(); // 4.OK, ufcs }
Comment #1 by k.hara.pg — 2012-04-19T06:44:26Z
Comment #2 by github-bugzilla — 2012-04-19T14:14:42Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ec6a33778767db278613b058641c849ea7625b43 fix Issue 7945 - alias this doesn't work on function ref parameter
Comment #3 by k.hara.pg — 2012-05-20T23:46:01Z
*** Issue 7991 has been marked as a duplicate of this issue. ***