Youssef Shoaib [MOD]
03/16/2025, 12:23 AMvar x = null
x = 5
So that x gets inferred as Int?
. I think this was meant to work like builder inference by having a postponed type variable for the type of x, so that the type variable can be inferred as such.I believe this is very similar to OCaml's weak polymorphic types. Anyone remember where that idea was presented/proposed?Sam
03/16/2025, 8:37 AMYoussef Shoaib [MOD]
03/16/2025, 10:23 AMYoussef Shoaib [MOD]
03/16/2025, 10:26 AMval x = mutableListOf()
x.add(42)
Although this might not be implemented if there's concerns that a function call might need the exact type parameter? I think this'd be the case if we called a reified
function without having enough info to specify the type (but I think that works with builder inference right now, so maybe I'm just saying things lol)