Bug 6858 – opDispatch is unusable for property functions
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-10-26T21:04:00Z
Last change time
2014-03-19T21:30:13Z
Assigned to
nobody
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2011-10-26T21:04:04Z
struct Foo
{
@property void x(int) {}
}
struct Bar
{
Foo foo;
void opDispatch(string Field, Args...)(Args args)
{
foo.x = args;
}
}
void main()
{
Bar bar;
bar.x = 5;
}
Error: expected 1 function arguments, not 0
Of course there's no way DMD can tell in advance that opDispatch will invoke a property function, so it just expects opDispatch to return an lvalue to be assigned with 5. :/
Comment #1 by lt.infiltrator — 2014-03-19T21:30:13Z