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
czyzby
04/15/2017, 4:34 PM
I'm surprised it works. You guys have thought of every edge case, haven't you?