blob: 391fc3aa119123a159b0a892011266a330b78cbc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
Explanation: Every union type specifies the type of each alternative, like this:
The type of the first alternative is ❰Bool❱
⇩
┌──────────────────────────────────┐
│ < Left : Bool, Right : Natural > │ A union type with two alternatives
└──────────────────────────────────┘
⇧
The type of the second alternative is ❰Natural❱
However, these alternatives can only be annotated with types. For example, the
following union types are $_NOT valid:
┌────────────────────────────┐
│ < Left : Bool, Right : 1 > │ Invalid union type
└────────────────────────────┘
⇧
This is a term and not a type
┌───────────────────────────────┐
│ < Left : Bool, Right : Type > │ Invalid union type
└───────────────────────────────┘
⇧
This is a kind and not a type
You provided a union type with an alternative named:
↳ $txt0
... annotated with the following expression which is not a type:
↳ $txt1
Some common reasons why you might get this error:
● You accidentally typed ❰:❱ instead of ❰=❱ for a union literal with one
alternative:
┌─────────────────┐
│ < Example : 1 > │
└─────────────────┘
⇧
This could be ❰=❱ instead
|