[Issue 2557] inconsistent behavior when taking reference to member without instance
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jan 11 15:28:45 PST 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2557
smjg at iname.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |smjg at iname.com
Keywords| |accepts-invalid
------- Comment #2 from smjg at iname.com 2009-01-11 17:28 -------
It doesn't work. "works" means "behaves correctly", not "compiles without
error".
The code is wrong regardless of whether dofun is static or not. A.fun needs an
object of type A. But it doesn't have one.
----------
bz2557.d(21): Error: this for fun needs to be type A not type method_ref.B
bz2557.d(21): Error: cannot implicitly convert expression (&this.fun) of type
void delegate() to void function()
----------
--
More information about the Digitalmars-d-bugs
mailing list