My approach is doing what the extension mechanism would do in a statically typed way.
The getter is needed so users can call
outer.inner.someThing = 'foo'
The closure method is for the curly brace syntax:
outer {
inner {
someThing = 'foo'
}
}
If you are happy with using extensions, that’s perfectly fine I just wanted to give you the alternative. We prefer that one as it makes it easier for others to discover the API.