ceylon/ceylon-spec — Issue #121: Forward references between toplevel declarations in same file
Author: gavinking
Created: 2011-12-24 17:56:41+00:00
State: open
Labels: clarification, high priority

A user tried the following all in the same file:

void foo(Boolean condition) {
if (condition) {
bar(false);
}
else {
print("FOO");
}
}
void bar(Boolean condition) {
if (condition) {
foo(false);
}
else {
print("BAR");
}
}

Which results in `not yet declared: bar`.

I think it might not correct that we do this of check for toplevel decs, even toplevel decs in the same file, but I'm not 100% certain on that. At the very least this case should be clarified in the spec.