www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3464] New: is( void function() == function) is false

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3464

           Summary: is( void function() == function) is false
           Product: D
           Version: 2.035
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dsimcha yahoo.com


--- Comment #0 from David Simcha <dsimcha yahoo.com> 2009-11-01 15:21:27 PST ---
pragma(msg, is( void delegate() == delegate).stringof);  // true
pragma(msg, is( void function() == function).stringof);  // false

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 01 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3464


Lars T. Kyllingstad <bugzilla kyllingen.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla kyllingen.net


--- Comment #1 from Lars T. Kyllingstad <bugzilla kyllingen.net> 2009-11-02
00:00:05 PST ---
This is apparently intentional. I recently brought up the same issue on the NG:

http://www.digitalmars.com/d/archives/digitalmars/D/The_bizarre_world_of_typeof_99461.html#N99486

Quoting Don:
"real function()" is a *function pointer*, but is(xxx == function) tests to see
if xxx is a *function*, not a *function pointer*.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 02 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3464



--- Comment #2 from David Simcha <dsimcha yahoo.com> 2009-11-09 06:32:47 PST ---
So what is the proper way to test if something is a function pointer then?  It
seems horribly inconsistent with delegates.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 09 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3464


Max Samukha <samukha voliacable.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |samukha voliacable.com


--- Comment #3 from Max Samukha <samukha voliacable.com> 2009-11-09 07:14:01
PST ---
One way to test: is(typeof(*T.init) == function)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 09 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3464


David Simcha <dsimcha yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


--- Comment #4 from David Simcha <dsimcha yahoo.com> 2010-08-15 21:23:01 PDT ---
I'll mark this invalid, since the language lawyers (IANALL) say it is, and the
better solution now that it exists is std.traits.isFunctionPointer.

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