[Issue 2557] inconsistent behavior when taking reference to member without instance

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 12 05:15:22 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2557





------- Comment #8 from smjg at iname.com  2009-01-12 07:15 -------
(In reply to comment #7)
> Makes sense. Perhaps, another enhancement report should be created with a
> request to change typeof(&A.foo) from void function() to void delegate() with a
> dg.ptr being null.

That would still be prone to accidental misuse IMO.

Really, D should do one of the following:
(a) add method pointer types
(b) define &A.foo to be of a type that has the context pointer as just another
parameter (which might break if ABI changes to support function-to-delegate
conversion are implemented)
(c) (continue to) disallow &A.foo altogether


-- 



More information about the Digitalmars-d-bugs mailing list