Skip to content

Commit 0b938da

Browse files
committed
Extra precision on polyvar inference
1 parent 42264f3 commit 0b938da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pages/docs/manual/latest/polymorphic-variant.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ Here is an example on how to make a minimum set of `basicBlueTones` extensible f
358358
type basicBlueTone<'a> = [> #Blue | #DeepBlue | #LightBlue ] as 'a
359359
type color = basicBlueTone<[#Blue | #DeepBlue | #LightBlue | #Purple]>
360360
361-
let color: color = #Purple
361+
let color: color = #Purple
362362
363363
// This will fail due to missing minimum constructors:
364364
type notWorking = basicBlueTone<[#Purple]>
@@ -402,7 +402,7 @@ var message = "Hello " + theCompany;
402402

403403
</CodeTab>
404404

405-
**Note**: for the coercion to work, the poly variant type needs to be closed. You'd need to annotate it, since an automatically inferred type ends up being open with a lower bound `[>`.
405+
**Note**: for the coercion to work, the poly variant type needs to be closed; you'd need to annotate it, since otherwise, `theCompany` would be inferred as `[> #Apple]`.
406406

407407
## Tips & Tricks
408408

0 commit comments

Comments
 (0)