D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5887 - with statement doesn't work with subtyping
Summary: with statement doesn't work with subtyping
Status: RESOLVED DUPLICATE of issue 6711
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other All
: P2 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-25 17:34 UTC by Andrej Mitrovic
Modified: 2011-09-24 16:58 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2011-04-25 17:34:53 UTC
struct Foo
{
    void test() {}
}

struct Bar
{
    Foo foo;
    alias foo this;
}

void main()
{
    Bar bar;  
    bar.test();  // ok
    
    with(bar)
    {
        test();  // Error: undefined identifier test
    }
}
Comment 1 Andrej Mitrovic 2011-09-24 16:58:16 UTC

*** This issue has been marked as a duplicate of issue 6711 ***