[Issue 4891] Assignment from non-pure function to pure function pointer compiles when it shouldn't

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 6 19:38:13 PDT 2011


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


yebblies <yebblies at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies at gmail.com
         Resolution|                            |DUPLICATE


--- Comment #3 from yebblies <yebblies at gmail.com> 2011-06-06 19:33:40 PDT ---
This is a dupe of 3797, the purity of a function pointer (among other things)
is not checked when performing implicit conversions.

With dmd pull 88 you get the following error from dmd:
testx.d(26): Error: constructor testx.S.this (int function(int) pure func) is
no
t callable using argument types (int function(int num))
testx.d(26): Error: cannot implicitly convert expression (& add1) of type int
fu
nction(int num) to int function(int) pure

*** This issue has been marked as a duplicate of issue 3797 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list