ceylon/ceylon-compiler — Issue #222: for loop does not box string
Author: gavinking
Created: 2011-11-23 18:47:06+00:00
State: open
Labels: BEGINNER, BUG

The following code:

for (c in "hello world!") {
print(c);
}

Results in this error:

symbol : method getIterator()
location: class java.lang.String
for (c in "hello world!") {
^

This is the generated tree:

for (ceylon.language.Iterator $c$iter$7 = "hello world!".getIterator(); $c$iter$7 != null; $c$iter$7 = $c$iter$7.getTail()) {
final char c = $c$iter$7.getHead().charValue();
.ceylon.language.print.print(.ceylon.language.Character.instance(c));
}