@@ -210,7 +210,7 @@ let baz = [a, b, c];
210210```
211211
212212In this example, both ` foo ` and ` bar ` have the type
213- ` LubCoerce(typeof(a), typeof(a), typeof(c)) ` and ` baz ` have the type
213+ ` LubCoerce(typeof(a), typeof(a), typeof(c)) ` and ` baz ` has the type
214214` [LubCoerce(typeof(a), typeof(b), typeof(c)); 3] ` .
215215
216216LUB coercion is performed by the following algorithm:
@@ -242,19 +242,17 @@ LubCoerce(vars...):
242242
243243LUB coercion has the following properties:
244244
245- 1 . Order independent: e.g. ` LubCoerce(ty0, ty1, ty2, ty3) ` equals to
246- ` LubCoerce(ty1, ty0, ty4, ty3) ` .
247- 2 . ` LubCoerce(ty0, ty1, ty2, ...) ` equals to
245+ 1 . ` LubCoerce(ty0, ty1, ty2, ...) ` equals to
248246 ` LubCoerce(LubCoerce(ty0, ty1), ty2, ...) `
249- 3 . ` LubCoerce(ty0, ty1) == Some(ty2) ` means both ` ty0 ` and ` ty1 ` can be coerced
247+ 2 . ` LubCoerce(ty0, ty1) == Some(ty2) ` means both ` ty0 ` and ` ty1 ` can be coerced
250248 to ` ty2 ` .
251249
252- Note the feature No. 3 , it uses the word "means" rather than "if and only if".
250+ Note the feature No. 2 , it uses the word "means" rather than "if and only if".
253251That's because currently if ` ty0 ` and ` ty1 ` can be coerced to ` ty2 ` and
254- unfortunately ` ty2 ` equals to neither ` ty0 ` nor ` ty1 ` , there are only one
252+ if ` ty2 ` equals to neither ` ty0 ` nor ` ty1 ` , there is only one
255253special situation where we can get ` LubCoerce(ty0, ty1) == Some(ty2) ` :
256254` LubCoerce((FnDef | Closure), (FnDef | Closure)) == Some(FnPtr) ` (where Closure
257- is non-capturing). You can check it with the pseudo code.
255+ is non-capturing).
258256
259257When an expression that performs LUB coercion has an expected type, the
260258expected type is added to the list of types the coercion operates on. So,
0 commit comments