Shaun Wild
10/26/2025, 2:59 PMShaun Wild
10/26/2025, 3:03 PMfoo as required, so the IDE will hint, or even error, saying the value must be set?
• Also, when you use autocomplete in the context of a type-safe builder, it feels like the direct properties are hidden amongst the list of other properties, when I feel like they should be higher priority.Shaun Wild
10/26/2025, 3:08 PMShaun Wild
10/26/2025, 3:08 PMinput is so far down the list, IMO it should be right at the top.Joffrey
10/26/2025, 3:09 PMShaun Wild
10/26/2025, 3:10 PMShaun Wild
10/26/2025, 3:11 PMbinding {
control = reference("control/CastSpell")
input = key(<http://Input.Keys.SPACE|Input.Keys.SPACE>)
}
vs
binding(reference("control/CastSpell", key(<http://Input.Keys.SPACE|Input.Keys.SPACE>)))hfhbd
10/26/2025, 3:32 PMhfhbd
10/26/2025, 3:33 PMhfhbd
10/26/2025, 3:36 PMkotlin
fun foo(customConfig: Binding.() -> Unit) {
binding {
control = reference("control/CastSpell")
input = key(Input.Keys.SPACE)
customConfig()
}
}hfhbd
10/26/2025, 3:37 PMShaun Wild
10/26/2025, 3:43 PMShaun Wild
10/26/2025, 3:45 PMShaun Wild
10/26/2025, 5:31 PMdmitriy.novozhilov
10/27/2025, 6:58 AMfun build(init : XYZBuilder.() -> Unit): XYZ {
contract {
callsInPlace(init, InvocationKind.EXACTLY_ONCE)
expectsTo(init, CallKind(XYZBuilder::setValX, InvocationKind.EXACTLY_ONCE, receiverOf(init)))
expectsTo(init, CallKind(XYZBuilder::setVarY, InvocationKind.AT_LEAST_ONCE, receiverOf(init)))
expectsTo(init, CallKind(XYZBuilder::setDefaultValZ, InvocationKind.AT_MOST_ONCE, receiverOf(init)))
}
val xyzBuilder = XYZBuilder()
xyzBuilder.init()
return xyzBuilder.create()
}
The prototype was promising, but it was decided to pause work on it until we get a proper picture what actually contracts are in the language.