If you do not control types used in your dsl, you ...
# getting-started
i
If you do not control types used in your dsl, you can apply dsl annotation to the receiver type of function-with-receiver parameter, something like this:
Copy code
fun skin(init: (@MyStyleDsl Skin).() -> Unit): Skin
where
MyStyleDsl
is an annotation, annotated with
@DslMarker
👍 3
c
I'm surprised it works. You guys have thought of every edge case, haven't you?
@DslMarker
is an underappreciated API!