码迷,mamicode.com
首页 > 其他好文 > 详细

scala Weak Conformance

时间:2018-12-18 20:55:43      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:short   gen   wing   forms   href   upper   int   least   spec   

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

scala Weak Conformance

标签:short   gen   wing   forms   href   upper   int   least   spec   

原文地址:https://www.cnblogs.com/suanec/p/10139882.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!