ceylon/ceylon-compiler — Issue #409: Runtime bug with empty and [].
Author: FroMage
Created: 2012-02-28 16:47:35+00:00
State: open
Labels: BUG, high priority

This code fails at runtime:

```java
String[] empty = {};
String[] f = empty[].uppercased;
```

With this exception:

```
java.lang.ClassCastException: ceylon.language.$empty$1 cannot be cast to ceylon.language.Sequence
```

Because the generated code for spread `[].` starts with:

```java
final ceylon.language.Iterable empty = ceylon.language.$empty.getEmpty();
ceylon.language.Sequence $spread$4$0 = (ceylon.language.Sequence)empty;
```