Anyone know why you can’t have bounds on type alia...
# compiler
r
Anyone know why you can’t have bounds on type alias parameters? I was trying to do this:
typealias Fact<T : Any> = Pair<FactName, T>
in order to ensure that you can’t put null in it, but no dice.
e
I think they introduced
<T & Any>
in 1.6.0 preview for this use case, https://youtrack.jetbrains.com/issue/KT-26245
f
T & Any
wouldn't matter here because
typealias Fact<T & Any>
is not valid kotlin.
T & Any
is a type just like
MutableList<T>
is.