If I write:
var a = 'a,b,c'.split(',')
a = a.tail
it validates and compiles, but I get a runtime error on the second line.
Is this working as intended in the Xtend2 type system, or a bug?
There seems to be 'something' wrong with the situation, because it seems impossible to determine the expected conversion behavior outside of trial-and-error and/or inspecting the internals of functions you will be calling.
In this case the call to IterableExtensions.tail wraps the already wrapped array, so it doesn't know how to unwrap it afterward.
String[] _split = "a,b,c".split(",");
String[] a = _split;
final String[] typeConverted_a = (String[])a;
Iterable<String> _tail = IterableExtensions.<String>tail(((Iterable<String>)Conversions.doWrapArray(typeConverted_a)));
a = ((String[])Conversions.unwrapArray(_tail));