I'm curious about how to simplify the constraint (...
# compiler
i
I'm curious about how to simplify the constraint (e.g.
simplifyLowerConstraint
,
simplifyUpperConstraint
). if we have
Foo <: T?
, how can we introduce
Foo & Any <: T
? I have read kotlin specification Definitely Non-nullable Types part , it mention
T & Any
is non-nullable type , but it's only used for type parameter. against
Foo & Any
is just a intersection type or it's an definitely non-nullable type?
d
DNN(T)
and
T & Any
are the identical types There is a special abstraction for definitely non null types only for historical and performance reasons
i
can you step by step explain how
Foo <: T?
can introduce
Foo & Any <: T
? thank you
d
Foo <: T?
Foo <: T & Nothing?
expand
T?
Foo & Any <: T
remove
null
from values of types in both sides
thank you color 1