mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 22:28:45 +01:00
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.
20 lines
268 B
Plaintext
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
|