Issue 11800 - alias this matching incorrectly changes lvalue-ness
Summary: alias this matching incorrectly changes lvalue-ness
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2013-12-22 05:14 UTC by Kenji Hara
Modified: 2013-12-22 14:27 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 Kenji Hara 2013-12-22 05:14:37 UTC
Spin-off issue from: https://d.puremagic.com/issues/show_bug.cgi?id=5363#c4

Reduced test case:

struct A
{
    B b;
    alias b this;
}

struct B
{
    static struct Value {}
    Value value;
    alias value this;

    void foo(ref const B rhs)
    {
    }
}

void main()
{
    A a;
    B b;
    b.foo(a);  // line 22
}

test.d(22): Error: B(a.b.value) is not an lvalue
Comment 2 github-bugzilla 2013-12-22 13:22:36 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/d1fec048072baeae596bc984ad67de201594015c
fix Issue 11800 - alias this matching incorrectly changes lvalue-ness

https://github.com/D-Programming-Language/dmd/commit/30aee1d5978c7c0cca5a13741371584214f3772a
Merge pull request #3009 from 9rnsr/fix11800

Issue 11800 - alias this matching incorrectly changes lvalue-ness