D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6694 - with statement doesn't work with functions that return structs
Summary: with statement doesn't work with functions that return structs
Status: RESOLVED DUPLICATE of issue 6685
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-19 09:14 UTC by Andrej Mitrovic
Modified: 2011-09-19 18:02 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 Andrej Mitrovic 2011-09-19 09:14:03 UTC
struct Foo { }
Foo foo() { Foo _foo; return _foo; }

void main()
{
    with (foo()) { }
}

Error: foo() is not an lvalue

For me this is particularly a problem when using property functions.
Comment 1 yebblies 2011-09-19 18:02:33 UTC

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