> > > @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 > functions (can't really remember the specifics). What I am passing are pure > js objects modeled with jsinterop, and they still count as js, not java. So > I am expecting to get back what I feed in / declared at the start. > > D3 is a JS api, even if some function says it will return an array of T, it is a JavaScript array, so there is no (type) guarantee that the array is of T. So it is an array of things, all of them of type T.
A java T[] has even stronger semantics, if you set an element it will check that it is the correct type. So the D3 array is like an Object[] that happens to be filled all with Ts. > So what do I want: Double[] to be castable to double[] in the GWT js > context (not in the java context). I don't know if this is possible but it > is definitely desirable. (The same for String[] and Boolean[]) and a pony > of course :-) > > Again here Double[] and double[] have very different semantics in Java. - you can cast Double[] to Object[] but not double[] to Object[] - you can store nulls in Double[] but not in double[]. They are semantically different. I agree that in some circumstances it seems convenient to ignore those. But in general GWT follows Java semantics (with a few exceptions) > Thanks again. > > -- > You received this message because you are subscribed to the Google Groups > "GWT Contributors" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/google-web-toolkit-contributors/CAKbOjExku8sLUm3Ky7B6OF-gx% > 3DvgvdP_v8nd-Pi0WNeqzyv06g%40mail.gmail.com > <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAKbOjExku8sLUm3Ky7B6OF-gx%3DvgvdP_v8nd-Pi0WNeqzyv06g%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "GWT Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAC7T7gkupiRhKbO9CAmnKO9LUSh26veVjnQ0LqAGemeJvFWm9A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
