``` @DslMarker annotation class ParentDsl @DslMar...
# announcements
d
Copy code
@DslMarker
annotation class ParentDsl

@DslMarker
annotation class ChildDsl

@ParentDsl
class Parent(block: Parent.() -> Unit) {
    init { this.block() }

    fun parentOnly() = println("hello world")

    fun child(block: Child.() -> Unit) {
        val child = Child()
        child.block()
    }
}

@ChildDsl
class Child


val parent = Parent {
    child {
        // How to make this impossible?
        parentOnly()
    }
}