www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6755] New: Better wrong function pointer error message

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

           Summary: Better wrong function pointer error message
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



void bar(void function(const int) f) {}
void foo(const float c) {}
void main() {
    bar(&foo);
}


DMD 2.056head gives:

test.d(4): Error: function test.bar (void function(const const(int)) f) is not
callable using argument types (void function(const const(float) c))
test.d(4): Error: cannot implicitly convert expression (& foo) of type void
function(const const(float) c) to void function(const const(int))


I'd like it to print "const(int)" or "const int" instead "const const(int)".

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


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
           Platform|Other                       |All
         OS/Version|Windows                     |All



I had already posted a patch for this issue as a part of other fix.

https://github.com/D-Programming-Language/dmd/pull/429

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


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |FIXED



17:10:34 PDT ---
Seems fixed by some other pull, it's now:

test.d(4): Error: function test.bar (void function(const(int)) f) is not
callable using argument types (void function(const(float) c))

test.d(4): Error: cannot implicitly convert expression (& foo) of type void
function(const(float) c) to void function(const(int))

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