Hunter
08/22/2025, 6:08 PMcontext(...: Foo)
over and over again. What if you could create context-aliases that look like keywords? I.e.
interface ServerContext
contextalias server = context(serverContext: ServerContext)
server fun foo() { ... } // same as context(_: ServerContext) fun foo()
This one is a bit of a long-shot, and I would be open to alternatives, but something like this would be nice.Youssef Shoaib [MOD]
08/22/2025, 9:12 PMServerContext
parameter? If so, you can do something like:
context(s: ServerContext)
val serverContext get() = s
Alexis Manin
08/23/2025, 10:00 AMAdrian Stypiński
08/23/2025, 5:49 PMYoussef Shoaib [MOD]
08/24/2025, 5:34 PMHunter
08/25/2025, 3:29 PMjoseph_ivie
08/25/2025, 3:34 PMcontext(s: ServerContext) {
fun a(): Int
fun b(input: Int): Int
fun c(input: Int)
}
What about something like this for making multiple decorations? It doesn't solve for lambda types, but it could make sense for everything else
Edit: on second thought, I don't like this. Repetition is better because it's clearer. The aliases is a better solution to this.