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.
13 lines
246 B
Plaintext
13 lines
246 B
Plaintext
class Outer {
|
|
// TODO: Remove "this." when capitalized names are no longer top-level.
|
|
this.Inner.new() // expect runtime error: Null does not implement 'new()'.
|
|
|
|
class Inner {
|
|
construct new() {}
|
|
}
|
|
|
|
construct new() {}
|
|
}
|
|
|
|
Outer.new()
|