[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-kawa] [bug #39948] Better Java method resolution when using primiti
From: |
anonymous |
Subject: |
[Bug-kawa] [bug #39948] Better Java method resolution when using primitive arguments |
Date: |
Wed, 04 Sep 2013 22:39:10 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 |
URL:
<http://savannah.gnu.org/bugs/?39948>
Summary: Better Java method resolution when using primitive
arguments
Project: Kawa
Submitted by: None
Submitted on: Wed 04 Sep 2013 10:39:09 PM UTC
Category: Type declaration and inference
Severity: 3 - Normal
Item Group: Feature Request
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
Example:
$ cat Test.java
public class Test {
public void put(int i, Object o) {
System.out.println("int " + i + " -> " + o);
}
public void put(Integer i, Object o) {
System.out.println("Integer " + i + " -> " + o);
}
}
$ javac Test.java
$ java -cp kawa-1.13.jar:. kawa.repl
#|kawa:1|# (define (put x::Test i::int) (x:put i "dummy"))
/dev/stdin:1:30: warning - more than one definitely applicable method `put' in
Test
candidate: void Test.put(java.lang.Integer,java.lang.Object)
candidate: void Test.put(int,java.lang.Object)
#|kawa:2|# (put (Test) 44)
Integer 44 -> dummy
Since put was defined as taking a primitive int and not an Integer I'd expect
the put method to resolve to the int version of Test and not the Integer
version of Test.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?39948>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-kawa] [bug #39948] Better Java method resolution when using primitive arguments,
anonymous <=