Is there a way to restrict usage of external funct...
# getting-started
p
Is there a way to restrict usage of external functions in a dsl? I’m thinking about creating and exposing a dsl using which users can provide their own domain spec. Is there a way to restrict them from using non whitelisted imports or language features?
s
nope, the only instance of restricting normally valid kotlin code is the DslMarker-annotation that disallows invocation of methods from an "outer scope", see https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-dsl-marker/ for a better explanation. But it does a very specific thing and is not applicapble to restrict imports or other language features except one.