You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
They replace compounds type`A with B` (the old syntax is kept for the moment but will
26
+
They replace compound types`A with B` (the old syntax is kept for the moment but will
27
27
be deprecated in the future). Intersection types are one of the core features of DOT. They
28
28
are commutative: `A & B` and `B & A` represent the same type.
29
29
@@ -44,7 +44,7 @@ The primary goal of the language constructs in this section is to make the langu
44
44
45
45
- Generic tuples
46
46
47
-
([Pending](https://github.com/lampepfl/dotty/pull/2199)) Generic tuples treat a tuple with arbitrary elements as a nested sequence of pairs. E.g. `(a, b, c)` is shorthand `(a, (b, (c, ())))`. This lets us drop the current limit of 22 for maximal tuple length and allows generic programs over tuples analogous to what is done for `HList`s.
47
+
([Pending](https://github.com/lampepfl/dotty/pull/2199)) Tuples with arbitrary numbers of elements are treated as sequences of nested pairs. E.g. `(a, b, c)` is shorthand for `(a, (b, (c, ())))`. This lets us drop the current limit of 22 for maximal tuple length and it allows generic programs over tuples analogous to what is currently done for `HList`.
48
48
49
49
<aname="safety"></a>
50
50
## Safety
@@ -67,12 +67,12 @@ Listed in this section are new language constructs that help precise, typechecke
67
67
of some value or operation in a large code base, fix all type errors, and obtain
68
68
at the end a working program. But universal equality `==` works for all types.
69
69
So what should conceptually be a type error would not be reported and
70
-
runtime behavior would change instead. Multiversal equality closes that loophole.
70
+
runtime behavior might change instead. Multiversal equality closes that loophole.
71
71
72
72
- Null safety
73
73
74
74
(Planned) Adding a `null` value to every type has been called a "Billion Dollar Mistake"
75
-
by its creator, Tony Hoare. With the introduction of union types, we can now do better.
75
+
by its inventor, Tony Hoare. With the introduction of union types, we can now do better.
76
76
A type like `String` will not carry the `null` value. To express that a value can
77
77
be `null`, one will use the union type `String | Null` instead. For backwards compatibility and Java interoperability, selecting on a value that's possibly `null` will still be permitted but will have a declared effect that a `NullPointerException` can be thrown (see next section).
0 commit comments