Skip to content

Commit d2d04f6

Browse files
authored
Merge pull request #8439 from panacekcz/update-intersection-spec
Update Syntax section in documentation of intersection types
2 parents 91e5f35 + ae91f13 commit d2d04f6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/docs/reference/new-types/intersection-types-spec.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ title: "Intersection Types - More Details"
55

66
## Syntax
77

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

1314
```
1415
Type ::= ...| InfixType

0 commit comments

Comments
 (0)