Re: [gwt-contrib] Fwd: jsinterop woes: Part 2: return Double[]

2017-06-27 Thread Vassilis Virvilis
@Roberto, Agreed in all points. double[] and Double[] is not the same thing in java although it may be possible to be the same in js. So until java supports autoboxing and unboxing in arrays I can see your point. Vassilis On Tue, Jun 27, 2017 at 1:41 AM, 'Roberto Lublinerman' via GWT

Re: [gwt-contrib] Fwd: jsinterop woes: Part 2: return Double[]

2017-06-26 Thread 'Roberto Lublinerman' via GWT Contributors
> > > @Roberto > Please note that I am not mixing stuff (java and js objects in the same > array, or different kind of objects in the same array). > > D3 is doing the correct thing here. If you pass an array of something, > let's say T[] you can expect that you will be getting T and T[] out of D3

Re: [gwt-contrib] Fwd: jsinterop woes: Part 2: return Double[]

2017-06-26 Thread Vassilis Virvilis
Hi and thanks for answering. I also tend to believe this is not a bug - but - it is definitely in my wish list. @Colin jsinterop is certainly kind of fragile but if you bang your head against it at the end you start understanding the errors. In most cases you can fix the error by making the java

Re: [gwt-contrib] Fwd: jsinterop woes: Part 2: return Double[]

2017-06-26 Thread Ignacio Baca Moreno-Torres
Oh, the classic array problem! ;) https://github.com/gwtproject/gwt/issues/9318 IMO as you are wrapping a client lib, and this code is not going to be shared (used in JRE), so just use elemental2.core.Array. Probably JsArrayLike is enough as an argument but returning an Array it is easier to use.

Re: [gwt-contrib] Fwd: jsinterop woes: Part 2: return Double[]

2017-06-26 Thread 'Roberto Lublinerman' via GWT Contributors
On Mon, Jun 26, 2017 at 10:16 AM, Colin Alworth wrote: > The example isn't doing instanceof though, it is just making that the > return type for the method (albeit through the use of generics). Does this > suggest that we should stop using arrays to refer to raw JS data,

Re: [gwt-contrib] Fwd: jsinterop woes: Part 2: return Double[]

2017-06-26 Thread Colin Alworth
The example isn't doing instanceof though, it is just making that the return type for the method (albeit through the use of generics). Does this suggest that we should stop using arrays to refer to raw JS data, or at least expect that generics may fail in interesting ways around them (and at

Re: [gwt-contrib] Fwd: jsinterop woes: Part 2: return Double[]

2017-06-26 Thread 'Roberto Lublinerman' via GWT Contributors
The short answer is that this is also not a bug. Java arrays are typed, JS arrays are not. So none of the examples you have will fully work. E.g. If you do array instanceof Date[] on an array built in JS filled with Dates it will fail. A native array is best modeled as SomeNativeJsType[] where

[gwt-contrib] Fwd: jsinterop woes: Part 2: return Double[]

2017-06-26 Thread Vassilis Virvilis
Originally posted in gwt-users. The question here is the same with the previous one. Is this considered a bug? Should I report it as an issue? and if so where? Thanks. -- Forwarded message -- From: Vassilis Virvilis Date: Fri, Feb 24, 2017 at 2:44 PM