If a capitalized name cannot be resolved, a new top-level variable with its name is implicitly declared. If a real definition is not found later, a compile time error is raised. Mutual recursion at the top level works now! Fix #101. Fix #106.
15 lines
192 B
Plaintext
15 lines
192 B
Plaintext
var Global = "global"
|
|
|
|
class Foo {
|
|
method {
|
|
IO.print(Global)
|
|
}
|
|
|
|
static classMethod {
|
|
IO.print(Global)
|
|
}
|
|
}
|
|
|
|
(new Foo).method // expect: global
|
|
Foo.classMethod // expect: global
|