Skip to content

Commit 61aa293

Browse files
committed
Fix incredibly minor typo in union types doc
`if (true) name else password` is an `Object & Product`, not an `Object | Product`.
1 parent 5d9e31b commit 61aa293

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/docs/reference/union-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ scala> val either: Password | UserName = if (true) name else password
4242
val either: Password | UserName = UserName(Eve)
4343
```
4444

45-
The type of `res2` is `Object | Product`, which is a supertype of
45+
The type of `res2` is `Object & Product`, which is a supertype of
4646
`UserName` and `Product`, but not the least supertype `Password |
4747
UserName`. If we want the least supertype, we have to give it
4848
explicitely, as is done for the type of `Either`. More precisely, the

0 commit comments

Comments
 (0)