[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-kawa] [bug #39047] Wrong incompatible type (boolean) with expected
From: |
Matthieu Vachon |
Subject: |
[Bug-kawa] [bug #39047] Wrong incompatible type (boolean) with expected int |
Date: |
Thu, 23 May 2013 03:32:51 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36 |
URL:
<http://savannah.gnu.org/bugs/?39047>
Summary: Wrong incompatible type (boolean) with expected int
Project: Kawa
Submitted by: maoueh
Submitted on: Thu 23 May 2013 03:32:51 AM GMT
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
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:
package org.kawa.test.wrongincompatiblebool;
public class Simple {
public void create(int updateFlags) {
System.out.println("Integer Value: " + updateFlags);
}
public void create(boolean force) {
System.out.println("Boolean Value: " + force);
}
}
And the following Kawa script:
(module-name <org.kawa.test.wrongincompatiblebool>)
(define simple :: <org.kawa.test.wrongincompatiblebool.Simple> (make
<org.kawa.test.wrongincompatiblebool.Simple>))
(invoke simple 'create #t)
Kawa will issue the following warning:
(compiling wrong-incompatible-bool.scm to
org.kawa.test.wrongincompatiblebool)
wrong-incompatible-bool.scm:4:1: warning - type java.lang.Boolean is
incompatible with required type int
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
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Thu 23 May 2013 03:32:51 AM GMT Name: wrong-incompatible-bool.zip
Size: 1kB By: maoueh
Test case (one java file, one kawa file)
<http://savannah.gnu.org/bugs/download.php?file_id=28142>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?39047>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Bug-kawa] [bug #39047] Wrong incompatible type (boolean) with expected int,
Matthieu Vachon <=