CLOVIS
11/24/2026, 11:22 AMclass Foo(
val a: Int?,
val b: Int?,
)
fun foo(): Foo {
// …
}
If foo returns (no exception), then Foo.a is guaranteed non-nullMarat Akhin
11/24/2026, 11:54 AMYoussef Shoaib [MOD]
11/24/2026, 11:57 AMclass FooTout A: Int?, out B: Int?(
val a: A,
val b: B,
)
typealias Foo = FooT*, *
fun foo(): FooTInt, * {
// ..
}
This works well with contracts, too!
The intuition here to move “value-level information” (i.e. which properties have which types) into type-level information (using type parameters).