bugKawa - Bugs: bug #38890, Wrong more than one applicable...

 
 

bug #38890: Wrong more than one applicable method warning

Submitter:  Matthieu Vachon <maoueh>
Submitted:  Sun 05 May 2013 03:39:45 AM UTC
   
 
Category:  Scheme language Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  bothner
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 11 May 2013 06:35:32 PM UTC, comment #1: 

This one was rather tricky.  The second method is actually the addAll method inherited from Collection.  We adjust the "declaring class" to Set for improved bytecode binary compatibility, in the same way that javac does.  However, we did this in a way that confused Kawa's overload resolution.  The fix was to use two different Method objects for the two different purposes (overload resolution/type-checking vs code-generation).

Fix and testcase checked in.

Per Bothner <bothner>
Group administrator
Sun 05 May 2013 03:39:45 AM UTC, original submission:  

When compiling the attached file, Kawa issues a warning saying there is more than one applicable method for set `addAll`. Here the relevant part of the file:


(define (combine-sets (set-i :: <java.util.Set>) (set-j :: <java.util.Set>))
  (when (invoke set-i 'addAll set-j)
    (format (current-output-port) "All good~%")))


In my opinion, this is a bug since there is only one
definition for `addAll` in `java.util.Set`. The report warning shows twice the same signature, at least in its String form. Here the full compile log:


(compiling set-add-all.scm to org.kawa.test.setaddall)
set-add-all.scm:4:3: warning - more than one definitely applicable method `addAll' in java.util.Set
  candidate: boolean java.util.Set.addAll(ClassType java.util.Collection<? extends Type E>)
  candidate: boolean java.util.Set.addAll(ClassType java.util.Collection<? extends Type E>)


Regards,
Matt

Matthieu Vachon <maoueh>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #28021:  set-add-all.scm added by maoueh (467B - application/octet-stream - Kawa file showing the problem)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bothner (Posted a comment)
  • -email is unavailable- added by maoueh (Submitted the item)
  • -email is unavailable- added by maoueh
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-05-11 bothner StatusNone Fixed
        Assigned toNone bothner
        Open/ClosedOpen Closed
    2013-05-05 maoueh Attached File- Added set-add-all.scm, #28021
        Carbon-Copy- Added maoueh

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code