scala Weak Conformance

时间:2022-01-14 15:40:13

Weak Conformance

In some situations Scala uses a more general conformance relation. A type S weakly conforms to a type T, written S<:wT, if S<:T or both S and T are primitive number types and S precedes T in the following ordering.

Byte  <:w Short
Short <:w Int
Char <:w Int
Int <:w Long
Long <:w Float
Float <:w Double

A weak least upper bound is a least upper bound with respect to weak conformance.

SCALA-DOC-TYPES