This page is no longer maintained — Please continue to the home page at www.scala-lang.org

New arrays and Java varargs (Was: New arrays are here)

5 replies
milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.

On Mon, Sep 21, 2009 at 2:01 PM, martin odersky wrote:
> New arrays have landed in trunk. This was the hardest on longest bug
> fix I ever did! There are still some things to clean up, but I checked
> in anyway because I am seriously running out of time.

Before I open a Trac ticket ...

Is the following change from 2.7.5 expected as a consequence of the
array update or is it a regression?

J.java
public class J {
public void m(Object... args) {}
}

S.scala:
object Test {
def main(args : Array[String]) {
(new J).m(Array(Array('a', 'b', 'c')) : _*)
}
}

miles@lewis:scala$ scala/dists/latest/bin/scalac J.java S.scala
S.scala:3: error: type mismatch;
found : Array[Array[Char]]
required: Array[java.lang.Object]
(new J).m(Array(Array('a', 'b', 'c')) : _*)
^
one error found

With 2.7.x this compiles without error.

Cheers,

Miles

odersky
Joined: 2008-07-29,
User offline. Last seen 45 weeks 6 days ago.
Re: New arrays and Java varargs (Was: New arrays are here)

On Tue, Sep 22, 2009 at 3:17 PM, Miles Sabin wrote:
> On Mon, Sep 21, 2009 at 2:01 PM, martin odersky wrote:
>> New arrays have landed in trunk. This was the hardest on longest bug
>> fix I ever did! There are still some things to clean up, but I checked
>> in anyway because I am seriously running out of time.
>
> Before I open a Trac ticket ...
>
> Is the following change from 2.7.5 expected as a consequence of the
> array update or is it a regression?
>
I think I can fix this. Wait until tomorrow...

Cheers

milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: New arrays and Java varargs (Was: New arrays are here)

On Tue, Sep 22, 2009 at 2:45 PM, martin odersky wrote:
> I think I can fix this. Wait until tomorrow...

[18755] seems to have done the trick ... thanks ...

Cheers,

Miles

odersky
Joined: 2008-07-29,
User offline. Last seen 45 weeks 6 days ago.
Re: New arrays and Java varargs (Was: New arrays are here)

On Wed, Sep 23, 2009 at 6:59 PM, Miles Sabin wrote:
> On Tue, Sep 22, 2009 at 2:45 PM, martin odersky wrote:
>> I think I can fix this. Wait until tomorrow...
>
> [18755] seems to have done the trick ... thanks ...
>
I did not have the time to test that yet. Glad that it worked.

Caoyuan
Joined: 2009-01-18,
User offline. Last seen 42 years 45 weeks ago.
Re: New arrays and Java varargs (Was: New arrays are here)

Hi, Martin,

Thanks for the quick fix of #2381, I tested it on my machine, now all
Scala code of NetBeans plugin works.

Then, I filed another issue related to new Arrays
https://lampsvn.epfl.ch/trac/scala/ticket/2386

Cheers,
-Caoyuan

On Thu, Sep 24, 2009 at 4:09 PM, martin odersky wrote:
> On Wed, Sep 23, 2009 at 6:59 PM, Miles Sabin wrote:
>> On Tue, Sep 22, 2009 at 2:45 PM, martin odersky wrote:
>>> I think I can fix this. Wait until tomorrow...
>>
>> [18755] seems to have done the trick ... thanks ...
>>
> I did not have the time to test that yet. Glad that it worked.
>
>  -- Martin
>

odersky
Joined: 2008-07-29,
User offline. Last seen 45 weeks 6 days ago.
Re: New arrays and Java varargs (Was: New arrays are here)

On Thu, Sep 24, 2009 at 10:13 AM, Caoyuan wrote:
> Hi, Martin,
>
> Thanks for the quick fix of #2381, I tested it on my machine, now all
> Scala code of NetBeans plugin works.
>
Glad to know that! I ma happy that it was not so hard to port to the
new arrays then.

> Then, I filed another issue related to new Arrays
> https://lampsvn.epfl.ch/trac/scala/ticket/2386
>
I'll be able to have a look at this soon, I hope.

Cheers

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland