D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19284 - alias this not used in nested functions of a method
Summary: alias this not used in nested functions of a method
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 critical
Assignee: No Owner
URL: http://dlang.org/
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-02 21:27 UTC by Eyal
Modified: 2018-10-11 07:59 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 Eyal 2018-10-02 21:27:58 UTC
struct S { int x; }
struct T {
    S s;
    alias s this;
    void f() {
        x = 1;
        void wrapped() { x = 1; } // <-- 'x' not found, whereas 's.x' works fine
    }
}
Comment 1 Eyal 2018-10-05 10:08:57 UTC
'this.x' also works fine there.
Comment 2 RazvanN 2018-10-09 14:01:38 UTC
PR : https://github.com/dlang/dmd/pull/8814
Comment 3 github-bugzilla 2018-10-11 07:59:25 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/d8de5fd8562ce1cf0f56bf29493704587b327946
Fix Issue 19284 - alias this not used in nested functions of a method

https://github.com/dlang/dmd/commit/7d6743dea041caa3c33866088a20172744d4e4bf
Merge pull request #8814 from RazvanN7/Issue_19284

Fix Issue 19284 - alias this not used in nested functions of a method