Skip to content

Update Syntax section in documentation of intersection types #8439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions docs/docs/reference/new-types/intersection-types-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ title: "Intersection Types - More Details"

## Syntax

Syntactically, an intersection type `S & T` is similar to an infix type, where
the infix operator is `&`. `&` is treated as a soft keyword. That is, it is a
normal identifier with the usual precedence. But a type of the form `A & B` is
always recognized as an intersection type, without trying to resolve `&`.
Syntactically, the type `S & T` is an infix type, where the infix operator is `&`.
The operator `&` is a normal identifier
with the usual precedence and subject to usual resolving rules.
Unless shadowed by another definition, it resolves to the type `scala.&`,
which acts as a type alias to an internal representation of intersection types.

```
Type ::= ...| InfixType
Expand Down