Open bjansen opened 9 years ago
But you can't do something like that in Ceylon right?
Well, you can write more Ceylonic way instead:
return ["0", "1", "2"];
I guess this could work:
return createJavaStringArray({"0", "1", "2"})
@luolong we are trying to keep the original Java types, because the converted code might be used with interop. I think we could add an option to the converter to convert things like Java arrays to Ceylon sequences?
I think it would be a good idea ...
Sometimes you want to use it for interop, but I would also not mind using it to just for porting code from Java to Ceylon...
With ff98c4b, it converts:
new String[] { "0", "1", "2" };
to
createJavaObjectArray<String>({"0", "1", "2"});
but converts
String[] s = {"1", "2"};
to
ObjectArray<String> str2 = {"1", "2"};
The following Java code
results in