I’m trying to get model extensions defined on an i...
# announcements
r
I’m trying to get model extensions defined on an interface to only be accessed via the implementations of the interface. Unfortunately, it looks like within lambdas being passed to the implementations, the context required to actually use the extensions is not fulfilled. Here is an example of what I’m trying to do: https://pl.kotl.in/byJT79Q0W A quick summary:
Copy code
interface Foo{
  fun createContext(action: MyObject.() -> Unit)
  fun MyObject.makeChange()
}

myObject.makeChange() //this should be illegal
myFoo.createContext {
  makeChange() //this should be legal
}
Is there a way to achieve what I’m attempting?
b
maybe something like this? https://pl.kotl.in/HEaHvj9qq
r
Oof. That's a bit rough, but I see the direction I need to head. It looks like it requires me to elevate the lambda context to the interface level