Files
wren/test/language/class/multiply_nested.wren
Bob Nystrom 8ff11a3c2c Nested classes.
A class definition can appear directly within the body of a class. It
works similar to a class variable where the class object is stored in a
field and a getter is defined on the enclosing class to return it.

Unlike class variables, nested classes do not expose setters.
2015-12-21 15:29:08 -08:00

20 lines
268 B
Plaintext

class A {
construct new() {}
class B {
construct new() {}
class C {
construct new() {}
class D {
construct new() {}
def test() { System.print("ok") }
}
}
}
}
A.new().B.new().C.new().D.new().test() // expect: ok