lub(T1,... Tn)是什么意思?
问题描述:
以下引号来自
异常参数的声明类型,该异常参数表示其类型为
联合并带有替代项D1 | D2 | ... | Dn是 lub(D1,D2,...,Dn)。
什么是 lub(D1,... Dn)
在这里?
答
它代表最小上限,在§4.10.4。最小上限:
一组引用类型的最小上限或 lub是共享超类型比其他任何共享超类型都更具体(也就是说,没有其他共享超类型是最小上界的子类型)。
The least upper bound, or "lub", of a set of reference types is a shared supertype that is more specific than any other shared supertype (that is, no other shared supertype is a subtype of the least upper bound).