bugKawa - Bugs: bug #39047, Wrong incompatible type (boolean)...

 
 

bug #39047: Wrong incompatible type (boolean) with expected int

Submitted by:  Matthieu Vachon <maoueh>
Submitted on:  Thu 23 May 2013 03:32:51 AM UTC  
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  Per Bothner <bothner>
Open/Closed:  Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 03 Jun 2013 01:38:39 PM UTC, comment #3:

Thanks Per.

Also, I find it really great that you take the time to explain the cause of the problem. It helps me understand more of the internals of Kawa.

Best regards,
Matt

Matthieu Vachon <maoueh>
Mon 03 Jun 2013 06:17:35 AM UTC, comment #2:

This was somewhat tricky. The problem is Kawa follows the Scheme handling of boolean - any value can be treated as boolean. I.e. any value can be converted to boolean. This confused the logic for comparing types, so I made some changes that I think are cleaner.

Checked in fix, and a testcase based on yours. Thanks!

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Mon 27 May 2013 01:20:46 AM UTC, comment #1:

For this bug, we can reduce the test case to only a scheme file. Here it is:

Although a warning is issued, the right method is called. I attached the new test case.

(file #28182)

Matthieu Vachon <maoueh>
Thu 23 May 2013 03:32:51 AM UTC, original submission:

When a method is overloaded with two possibilities, one taking a boolean the other taking an int and the method is called in Kawa by using a boolean literal, Kawa picks the int one an issue a warning saying boolean is incompatible with type int.

Assume the following Java class:

And the following Kawa script:

Kawa will issue the following warning:

Since a boolean literal is used, I would have expected Kawa to pick the boolean version and not issue a warning.

I have attached my two files to this bug report in a zip archive.

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 #28182:  wrong-incompatible-bool.scm added by maoueh (487B - application/octet-stream - Same test case as before but only in scheme)
file #28142:  wrong-incompatible-bool.zip added by maoueh (1KiB - application/octet-stream - Test case (one java file, one kawa file))

 

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)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-06-03 bothner StatusNone => Fixed
        Assigned toNone => bothner
        Open/ClosedOpen => Closed
    2013-05-27 maoueh Attached File- => Added wrong-incompatible-bool.scm, #28182
    2013-05-23 maoueh Attached File- => Added wrong-incompatible-bool.zip, #28142

    Back to the top


    Powered by Savane 3.3