www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7558] New: Useless 'cannot implicitly convert' errors when number of function arguments is wrong

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

           Summary: Useless 'cannot implicitly convert' errors when number
                    of function arguments is wrong
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: clugdbug yahoo.com.au



When the compiler reports errors of the form "expected 6 function arguments,
not 5",
trying to implicitly convert the first 5 arguments generates spurious "cannot
implicitly convert XXX to YYY" errors.
To add value, the compiler could try to work out which argument is missing;
unless it does that, it shouldn't attempt the conversion.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 21 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7558


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



11:15:36 PST ---
An example demonstrating this would be useful.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 21 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7558




void bug7558(string x, int y, double z) {}

void main()
{
   bug7558(4, 2.2);
}   

DMD 1.073 / 2.057:

bug.d(5): Error: function bug.bug7558 (char[],int,double) does not match
paramet
er types (int,double)
bug.d(5): Error: cannot implicitly convert expression (4) of type int to char[]
bug.d(5): Error: cannot implicitly convert expression (2.2) of type double to
in
t
bug.d(5): Error: expected 3 function arguments, not 2


But the second and third errors don't happen in 2.058. Looks like this is a D1
only bug -- a patch that didn't get merged?

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