A current source of end-user mistakes and kog-level bugs is that you can accidentally reference top-level methods when you're inside a nested builder block:
val router = Router {
group("/prefix") {
mount(otherRouter)
}
}
In the above example, if RouteGroup didn't have the .mount() method, it'll call the top-level router .mount(otherRouter) which will mount the subrouter without a prefix.
To prevent these sorts of bugs in kog and for the end-user, kotlin 1.1 introduces dsl scope control (@DslMarker).
A current source of end-user mistakes and kog-level bugs is that you can accidentally reference top-level methods when you're inside a nested builder block:
In the above example, if
RouteGroup
didn't have the.mount()
method, it'll call the top-level router.mount(otherRouter)
which will mount the subrouter without a prefix.To prevent these sorts of bugs in kog and for the end-user, kotlin 1.1 introduces dsl scope control (
@DslMarker
).