[Issue 2735] Can't assign ref function to function pointer

2015-06-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2735

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|2.025   |D2

--


[Issue 2735] Can't assign ref function to function pointer

2009-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2735





--- Comment #5 from ma...@pochta.ru  2009-03-16 05:24 ---
alias typeof(c) refintf_t;


-- 



[Issue 2735] Can't assign ref function to function pointer

2009-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2735


bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||INVALID




--- Comment #6 from bugzi...@digitalmars.com  2009-03-16 20:07 ---
Please open different issues as different bug reports.


-- 



[Issue 2735] Can't assign ref function to function pointer

2009-03-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2735





--- Comment #1 from jarrett.billings...@gmail.com  2009-03-15 12:11 ---
I suppose it should be mentioned that it's not possible to declare a ref
function pointer, or else this would be a no-brainer:

ref int c() { static int a=2; return a; }
ref int function() d = c; // line 8

foo.d(8): variable foo.d only parameters or foreach declarations can be ref

Type inference, however, is able to figure it out:

ref int c() { static int a=2; return a; }
auto d = c; // whee


-- 



[Issue 2735] Can't assign ref function to function pointer

2009-03-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2735





--- Comment #2 from jlqu...@optonline.net  2009-03-15 13:11 ---
(In reply to comment #1)
 I suppose it should be mentioned that it's not possible to declare a ref
 function pointer, or else this would be a no-brainer:
 
 ref int c() { static int a=2; return a; }
 ref int function() d = c; // line 8

Oops, yes, I meant to write that :-)


-- 



[Issue 2735] Can't assign ref function to function pointer

2009-03-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2735


bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID




--- Comment #3 from bugzi...@digitalmars.com  2009-03-15 14:41 ---
The error message is correct, as a function that returns a reference is not the
same type as a function that does not return a reference.


-- 



[Issue 2735] Can't assign ref function to function pointer

2009-03-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2735


jarrett.billings...@gmail.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |




--- Comment #4 from jarrett.billings...@gmail.com  2009-03-15 15:23 ---
Then I suppose you didn't see my or Jerry's followup comments?  It's not
possible to declare a ref function pointer.  It's possible to infer it, but not
declare one.


--