-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtype-checking-test.jul
132 lines (132 loc) · 2.71 KB
/
type-checking-test.jul
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# should not error
testEmpty1: Empty = ()
# should error
testEmpty2: Empty = Empty
# should error
testEmpty3: Empty = (1)
# should not error
testEmptyLiteral1: () = ()
# should error
testEmptyLiteral2: () = 4
# should error
testEmptyLiteral3: () = (4)
# should error
testEmptyLiteral4: () = (a = 4)
# should not error
testIntegerLiteral1: 4 = 4
# should error
testIntegerLiteral2: 4 = 5
# should error
testBooleanLiteral: true = 4
# should not error
testBoolean1: Boolean = true
# should error
testBoolean2: Boolean = 6
# should not error
testInteger1: Integer = 4
# should error
testInteger2: Integer = 4f
# should not error
testNonZeroInteger1: NonZeroInteger = -2
# should error
testNonZeroInteger2: NonZeroInteger = 0
# should error
testNonZeroInteger2: NonZeroInteger = 3.5
# should not error
testFloat1: Float = 6f
# should error
testFloat2: Float = 6
# should not error
testText1: Text = §§
# should not error
testText2: Text = §hallo welt§
# should error
testText3: Text = 4
# should not error
testOr1: Or(4 5) = 4
# should error
testOr2: Or(4 5) = 6
# should not error
testOr3: Or(Integer 5) = 6
# should not error
testAnd1: And(4 4) = 4
# should error
testAnd2: And(4 5) = 5
# should error
testAnd3: And(4 5) = 6
# should not error
testAnd4: And(
(a: 4)
(b: 5)
) = (
a = 4
b = 5
)
# should error
testAnd5: And(
(a: 4)
(b: 5)
) = (
a = 4
b = 6
)
# should error
testNot1: Not(true) = true
# should not error
testNot2: Not(true) = false
t1 = Boolean.And(true)
t2 = Boolean.And(Not(true))
t3 = Boolean.Without(true)
# should not error
testWithout1: Boolean.Without(true) = false
testWithout11: Boolean.And(Not(true)) = false
# should error
testWithout2: Boolean.Without(true) = true
testWithout21: Boolean.And(Not(true)) = true
# should not error
testTuple1: (Float Integer) = (4f 1)
# should error
testTuple2: (Float 2) = (4f 1)
# should not error
testList1: List(Text) = (§aa§)
# should error
testList2: List(Text) = (§aa§ 4)
# should error
testList3: List(Text) = ()
# should not error
testDictionaryLiteral1: (a: 4) = (a = 4)
# should error
testDictionaryLiteral2: (a: 4) = (a = 6)
# should not error
testDictionaryLiteral3: (
a: 4
b: 6
) = (
a = 4
b = 6
)
# should not error
testDictionaryLiteral3a: (
a: 4
) = (
a = 4
b = 6
)
# should not error
testDictionaryLiteral4: (a: (b: 4)) = (a = (b = 4))
# should error
testDictionaryLiteral5: (a: (b: 4)) = (a = (b = 5))
# should error
testDictionaryLiteral6: (a: Float) = (a = (b = 4f))
# should not error
testDictionaryLiteral7: (a: Float) = (a = 4f)
# should not error
testDictionary1: Dictionary(Text) = (a = §4§)
# should error
testDictionary2: Dictionary(Text) = (a = 4)
# should error
testDictionary3: Dictionary(Text) = ()
# should not error
6.subtract(5)
# should error
().subtract(5)