Get static methods fully working.
They are compiled as local variables defined in an implicit scope surrounding the class. This has the right semantics and, better, means that there's no VM support needed for them. They're purely syntax sugar.
This commit is contained in:
@@ -4,3 +4,7 @@ class Foo {
|
||||
}
|
||||
|
||||
IO.print((new Foo).bar.baz) // expect: baz
|
||||
|
||||
// TODO: Test that "this" is the class when in a static method.
|
||||
// (Or disallow "this" in statics? It's useful since statics are
|
||||
// inherited.)
|
||||
|
||||
Reference in New Issue
Block a user