Dirk Hoffmann
03/14/2023, 3:15 PM<mailto:this@dsl.xxx|this@dsl.xxx>
) and I don't understand WHY.
I constructed a single executable File to showcase my "problem" (at the end of the file/code)Dirk Hoffmann
03/14/2023, 3:24 PMDslClass
itself delegate BOTH interfaces:
IDelegationIfcSpecialAndCommon by dslClassDelegateImpl
common { name..Special {
is visible without this@dsl.
and
special { name...Common {
is also visible without this@dsl.
Why is this?Dirk Hoffmann
03/14/2023, 3:35 PMTo make the compiler start controlling scopes you only have to annotate the types of all receivers used in the DSL with the same marker annotation.
which I think I did, so that: ..., the Kotlin compiler knows which implicit receivers are part of the same DSL and allows to call members of the nearest receivers only
(so why does it allow the implicit receiver of the parent DslClass
in my example code I gave?