[Issue 2695] pure functions can invoke impure function pointers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 22 01:30:36 PDT 2009


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





------- Comment #1 from clugdbug at yahoo.com.au  2009-04-22 03:30 -------
Created an attachment (id=334)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=334&action=view)
Patch for DMD2.029.

This patch also prevents pure functions from calling impure delegates.

It (correctly) does not prevent them from assigning to impure function
pointers/delegates -- it just mustn't call them. I've tested it with
delegates/functions passed as parameters, as well as defined as variables; I've
also tested it with template functions, and with structs defining opCall, and
made sure it doesn't cause problems with variables defined in module scope.


-- 



More information about the Digitalmars-d-bugs mailing list