[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-kawa] [bug #49537] 'format' on String[] (supported?) prints only fi
From: |
Per Bothner |
Subject: |
[Bug-kawa] [bug #49537] 'format' on String[] (supported?) prints only first |
Date: |
Sun, 6 Nov 2016 16:25:51 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36 |
Follow-up Comment #3, bug #49537 (project kawa):
A Java varargs methods that takes (S s, T... ts) is compiled to (S s, T[] ts).
For compatibility reasons, Java allows such a method to be called *either*
with an array or flattened: (s, ts) or (s, t1, t2, t2), where ts == {t1, t2,
t3}. The latter is basically compiled into the former.
For compatibility (again), Kawa allows either when calling a varargs method.
A varargs method is either one written as such in Java, or a Kawa method with
a #!rest parameter whose type is specified to be an array (rather than a
list).
There is obviously an ambiguity when T==Object and the number of varargs
arguments is 1.
See the explicitArrayAsVarArgsAllowed fied in PrimProcedure.java. I think
you'll find if you change that to false, the weird behavior goes away. I'll
probably change it to false for Kawa 3.0 (based on the invoke branch).
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?49537>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/