-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathinvalid-one-liners.yml
More file actions
126 lines (100 loc) · 2.73 KB
/
Copy pathinvalid-one-liners.yml
File metadata and controls
126 lines (100 loc) · 2.73 KB
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
# Declarations
# ============
- case: missing `;` in definition
code: unit$_ = Unit
error: |
Line 1, col 14: expected ";"
- case: missing `=` in definition
code: unit$_ Unit;
error: |
Line 1, col 12: expected "="
# Builtins
# ========
- case: invalid type specifier
code: |
// Must be `Type` or `#`, not `Wrong`:
merkle_proof#03 {X:Wrong} virtual_root:^X = MERKLE_PROOF X;
error: |
Line 2, col 20: expected "Type" or "#"
- case: invalid builtin expression
code: |
tempa$01 len:(## 9) external_address:(bits len) = TempA; // ok
tempb$01 len:(#@ 9) external_address:(bits len) = TempB;
errorStart: |
Line 2, col 16: expected "
# Math
# ====
- case: wrong math sign `-`
code: |
vm_tupref_any$_ {n:#} ref:^(VmTuple (n - 2)) = VmTupleRef n;
errorStart: |
Line 1, col 40: expected ")",
- case: wrong math sign `/`
code: |
vm_tupref_any$_ {n:#} ref:^(VmTuple (n / 2)) = VmTupleRef n;
errorStart: |
Line 1, col 40: expected ")",
- case: math with anonymous fields
code: transaction$0111 ^[ in_msg:bits256 ] + 1 = Transaction;
errorStart: |
Line 1, col 38: expected "=",
# Compares
# ========
- case: operator `==` used instead of `=` for compare
code: |
temps#_ {n:#} {m:#} {n = (~m)} = Temp n; // ok
temps#_ {n:#} {m:#} {n == (~m)} = Temp n; // not ok
errorStart: |
Line 2, col 25: expected
- case: nested compare
code: |
// Correct:
atemp total:(## 16) main:(## 16)
{ main <= total } { main >= 1 } = ValidatorSet;
// Wrong:
btemp total:(## 16) main:(## 16)
{ total <= main >= 1 } = ValidatorSet;
errorStart: |
Line 7, col 17: expected "}",
# Parens
# ======
- case: parens around constructor
code: |
(unit$_) = Unit;
errorStart: |
Line 1, col 1: expected end of input
- case: parens around tag
code: |
unit($_) = Unit;
errorStart: |
Line 1, col 6: expected
- case: parens around fields
code: |
nothing$0 ({X:Type}) = Maybe X;
errorStart: |
Line 1, col 12: expected
- case: parens around combinator
code: |
unit$_ = (Unit);
errorStart: |
Line 1, col 10: expected
# Skipping this test for now, because I cannot make it work.
- case: parens around combinator args
code: |
temp {n:#} x:(Unary ~n) = Temp (~(n + 1));
skip: true
- case: parens on the left of `*`
code: |
temp {n:#} = Temp (n * (2 + 1));
errorStart: |
Line 1, col 27: expected
- case: cannot apply operator to type
code: |
_ l:(## 7) { l <= 127 } v:(bits l * 8) = A;
errorStart: |
Line 1, col 35: expected
- case: cannot use a non-Nat field in an expression
code: |
_ v:int7 { v <= 127 } = A;
errorValidate: |
cannot use field 'v' in an expression unless it is either an integer or a type