ceylon/ceylon-compiler — Issue #291: Default arguments for nested method
Author: gavinking
Created: 2011-12-16 16:35:15+00:00
State: open
Labels: BUG, high priority

Finally, this case:

void run() {
void holaMundo(String name="mundo") {
print("hola " + name);
}
if (exists arg = process.arguments.first) {
holaMundo(arg);
}
else {
holaMundo();
}
}

Results in:

/Users/gavin/runtime-EclipseApplication/hello/src/hello.ceylon:8: modifier public static not allowed here
print("hola " + name);
^
/Users/gavin/runtime-EclipseApplication/hello/src/hello.ceylon:7: inner classes cannot have static declarations
void holaMundo(String name="mundo") {
^

Because we get an inner class with a static inner `$impl` class.