upload code
This commit is contained in:
commit
3f507064ce
111 changed files with 9258 additions and 0 deletions
10
integration/fail/type-mismatch/assignment-bool-int.out
Normal file
10
integration/fail/type-mismatch/assignment-bool-int.out
Normal file
|
@ -0,0 +1,10 @@
|
|||
Error: Type Mismatch
|
||||
╭─[assignment-bool-int.txt:2:7]
|
||||
│
|
||||
1 │ let foo: bool = true;
|
||||
· ──┬─
|
||||
· ╰─── Expected type `bool`,
|
||||
2 │ foo = 0;
|
||||
· ┬
|
||||
· ╰── but expression is of type `int`
|
||||
───╯
|
2
integration/fail/type-mismatch/assignment-bool-int.txt
Normal file
2
integration/fail/type-mismatch/assignment-bool-int.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
let foo: bool = true;
|
||||
foo = 0;
|
|
@ -0,0 +1,10 @@
|
|||
Error: Type Mismatch
|
||||
╭─[assignment-rc-tuple-bool-int.txt:2:9]
|
||||
│
|
||||
1 │ let foo: Rc<(bool,)> = Rc((true,));
|
||||
· ──┬─
|
||||
· ╰─── Expected type `bool`,
|
||||
2 │ foo.0 = 0;
|
||||
· ┬
|
||||
· ╰── but expression is of type `int`
|
||||
───╯
|
|
@ -0,0 +1,2 @@
|
|||
let foo: Rc<(bool,)> = Rc((true,));
|
||||
foo.0 = 0;
|
|
@ -0,0 +1,10 @@
|
|||
Error: Type Mismatch
|
||||
╭─[assignment-rc-tuple-option-rc.txt:2:9]
|
||||
│
|
||||
1 │ let foo: Rc<(Option<bool>,)> = Rc((None,));
|
||||
· ───┬──
|
||||
· ╰──── Expected type `Option<bool>`,
|
||||
2 │ foo.0 = Rc(true);
|
||||
· ─┬
|
||||
· ╰── but expression is of type `Rc<_>`
|
||||
───╯
|
|
@ -0,0 +1,2 @@
|
|||
let foo: Rc<(Option<bool>,)> = Rc((None,));
|
||||
foo.0 = Rc(true);
|
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[declaration-bool-int-arithmetic.txt:1:17]
|
||||
│
|
||||
1 │ let foo: bool = 1 + 2;
|
||||
· ──┬─ ──┬──
|
||||
· ╰─────────── Expected type `bool`,
|
||||
· │
|
||||
· ╰──── but expression is of type `int`
|
||||
───╯
|
|
@ -0,0 +1 @@
|
|||
let foo: bool = 1 + 2;
|
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[declaration-bool-int-negation.txt:2:17]
|
||||
│
|
||||
2 │ let foo: bool = -one;
|
||||
· ──┬─ ┬
|
||||
· ╰─────── Expected type `bool`,
|
||||
· │
|
||||
· ╰── but expression is of type `int`
|
||||
───╯
|
|
@ -0,0 +1,2 @@
|
|||
let one: int = 1;
|
||||
let foo: bool = -one;
|
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[declaration-bool-int-tuple-bool-bool-tuple.txt:1:31]
|
||||
│
|
||||
1 │ let foo: (bool, int) = (true, true);
|
||||
· ─┬─ ──┬─
|
||||
· ╰────────────────── Expected type `int`,
|
||||
· │
|
||||
· ╰─── but expression is of type `bool`
|
||||
───╯
|
|
@ -0,0 +1 @@
|
|||
let foo: (bool, int) = (true, true);
|
9
integration/fail/type-mismatch/declaration-bool-int.out
Normal file
9
integration/fail/type-mismatch/declaration-bool-int.out
Normal file
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[declaration-bool-int.txt:1:17]
|
||||
│
|
||||
1 │ let foo: bool = 0;
|
||||
· ──┬─ ┬
|
||||
· ╰─────── Expected type `bool`,
|
||||
· │
|
||||
· ╰── but expression is of type `int`
|
||||
───╯
|
1
integration/fail/type-mismatch/declaration-bool-int.txt
Normal file
1
integration/fail/type-mismatch/declaration-bool-int.txt
Normal file
|
@ -0,0 +1 @@
|
|||
let foo: bool = 0;
|
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[declaration-int-bool-conjunction.txt:1:16]
|
||||
│
|
||||
1 │ let foo: int = true && true;
|
||||
· ─┬─ ──────┬─────
|
||||
· ╰────────────────── Expected type `int`,
|
||||
· │
|
||||
· ╰─────── but expression is of type `bool`
|
||||
───╯
|
|
@ -0,0 +1 @@
|
|||
let foo: int = true && true;
|
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[declaration-int-bool-negation.txt:2:16]
|
||||
│
|
||||
2 │ let foo: int = !yes;
|
||||
· ─┬─ ┬
|
||||
· ╰─────── Expected type `int`,
|
||||
· │
|
||||
· ╰── but expression is of type `bool`
|
||||
───╯
|
|
@ -0,0 +1,2 @@
|
|||
let yes: bool = true;
|
||||
let foo: int = !yes;
|
9
integration/fail/type-mismatch/declaration-int-bool.out
Normal file
9
integration/fail/type-mismatch/declaration-int-bool.out
Normal file
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[declaration-int-bool.txt:1:16]
|
||||
│
|
||||
1 │ let foo: int = true;
|
||||
· ─┬─ ──┬─
|
||||
· ╰────────── Expected type `int`,
|
||||
· │
|
||||
· ╰─── but expression is of type `bool`
|
||||
───╯
|
1
integration/fail/type-mismatch/declaration-int-bool.txt
Normal file
1
integration/fail/type-mismatch/declaration-int-bool.txt
Normal file
|
@ -0,0 +1 @@
|
|||
let foo: int = true;
|
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[declaration-int-int-comparison.txt:1:16]
|
||||
│
|
||||
1 │ let foo: int = 1 == 2;
|
||||
· ─┬─ ───┬──
|
||||
· ╰──────────── Expected type `int`,
|
||||
· │
|
||||
· ╰──── but expression is of type `bool`
|
||||
───╯
|
|
@ -0,0 +1 @@
|
|||
let foo: int = 1 == 2;
|
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[declaration-int-tuple-bool-tuple.txt:1:20]
|
||||
│
|
||||
1 │ let foo: (int,) = (true,);
|
||||
· ─┬─ ──┬─
|
||||
· ╰───────────── Expected type `int`,
|
||||
· │
|
||||
· ╰─── but expression is of type `bool`
|
||||
───╯
|
|
@ -0,0 +1 @@
|
|||
let foo: (int,) = (true,);
|
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[declaration-unit-one-tuple.txt:1:15]
|
||||
│
|
||||
1 │ let foo: () = (1,);
|
||||
· ─┬ ──┬─
|
||||
· ╰───────── Expected tuple with 0 elements,
|
||||
· │
|
||||
· ╰─── but expression has 1 elements
|
||||
───╯
|
|
@ -0,0 +1 @@
|
|||
let foo: () = (1,);
|
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[expression-arithmetic-int-bool.txt:1:20]
|
||||
│
|
||||
1 │ let foo: int = 1 + true;
|
||||
· ┬ ──┬─
|
||||
· ╰─────── Expected type `int`,
|
||||
· │
|
||||
· ╰─── but expression is of type `bool`
|
||||
───╯
|
|
@ -0,0 +1 @@
|
|||
let foo: int = 1 + true;
|
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[expression-comparison-int-bool.txt:1:22]
|
||||
│
|
||||
1 │ let foo: bool = 1 == true;
|
||||
· ─┬ ──┬─
|
||||
· ╰─────── Expected type `int`,
|
||||
· │
|
||||
· ╰─── but expression is of type `bool`
|
||||
───╯
|
|
@ -0,0 +1 @@
|
|||
let foo: bool = 1 == true;
|
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[expression-conjunction-bool-int.txt:1:25]
|
||||
│
|
||||
1 │ let foo: bool = true || 1;
|
||||
· ─┬ ┬
|
||||
· ╰──── Expected type `bool`,
|
||||
· │
|
||||
· ╰── but expression is of type `int`
|
||||
───╯
|
|
@ -0,0 +1 @@
|
|||
let foo: bool = true || 1;
|
9
integration/fail/type-mismatch/expression-int-0.out
Normal file
9
integration/fail/type-mismatch/expression-int-0.out
Normal file
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[expression-int-0.txt:2:16]
|
||||
│
|
||||
2 │ let bar: int = foo.0;
|
||||
· ──┬─┬
|
||||
· ╰──── Expression is of type `int`,
|
||||
· │
|
||||
· ╰── but expected type `(_, ..)`
|
||||
───╯
|
2
integration/fail/type-mismatch/expression-int-0.txt
Normal file
2
integration/fail/type-mismatch/expression-int-0.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
let foo: int = 1;
|
||||
let bar: int = foo.0;
|
9
integration/fail/type-mismatch/expression-minus-bool.out
Normal file
9
integration/fail/type-mismatch/expression-minus-bool.out
Normal file
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[expression-minus-bool.txt:1:17]
|
||||
│
|
||||
1 │ let foo: int = -true;
|
||||
· ┬──┬─
|
||||
· ╰────── Expected type `int`,
|
||||
· │
|
||||
· ╰─── but expression is of type `bool`
|
||||
───╯
|
1
integration/fail/type-mismatch/expression-minus-bool.txt
Normal file
1
integration/fail/type-mismatch/expression-minus-bool.txt
Normal file
|
@ -0,0 +1 @@
|
|||
let foo: int = -true;
|
9
integration/fail/type-mismatch/expression-not-int.out
Normal file
9
integration/fail/type-mismatch/expression-not-int.out
Normal file
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[expression-not-int.txt:1:18]
|
||||
│
|
||||
1 │ let foo: bool = !0;
|
||||
· ┬┬
|
||||
· ╰─── Expected type `bool`,
|
||||
· │
|
||||
· ╰── but expression is of type `int`
|
||||
───╯
|
1
integration/fail/type-mismatch/expression-not-int.txt
Normal file
1
integration/fail/type-mismatch/expression-not-int.txt
Normal file
|
@ -0,0 +1 @@
|
|||
let foo: bool = !0;
|
9
integration/fail/type-mismatch/expression-unit-0.out
Normal file
9
integration/fail/type-mismatch/expression-unit-0.out
Normal file
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[expression-unit-0.txt:1:16]
|
||||
│
|
||||
1 │ let foo: int = ().0;
|
||||
· ─┬┬─
|
||||
· ╰──── Found tuple with 0 elements,
|
||||
· │
|
||||
· ╰─── but expression requires at least 1 elements
|
||||
───╯
|
1
integration/fail/type-mismatch/expression-unit-0.txt
Normal file
1
integration/fail/type-mismatch/expression-unit-0.txt
Normal file
|
@ -0,0 +1 @@
|
|||
let foo: int = ().0;
|
9
integration/fail/type-mismatch/if-condition-int.out
Normal file
9
integration/fail/type-mismatch/if-condition-int.out
Normal file
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[if-condition-int.txt:1:4]
|
||||
│
|
||||
1 │ if 0 {}
|
||||
· ─┬ ┬
|
||||
· ╰──── Expected type `bool`,
|
||||
· │
|
||||
· ╰── but expression is of type `int`
|
||||
───╯
|
1
integration/fail/type-mismatch/if-condition-int.txt
Normal file
1
integration/fail/type-mismatch/if-condition-int.txt
Normal file
|
@ -0,0 +1 @@
|
|||
if 0 {}
|
9
integration/fail/type-mismatch/while-condition-int.out
Normal file
9
integration/fail/type-mismatch/while-condition-int.out
Normal file
|
@ -0,0 +1,9 @@
|
|||
Error: Type Mismatch
|
||||
╭─[while-condition-int.txt:1:7]
|
||||
│
|
||||
1 │ while 0 {}
|
||||
· ──┬── ┬
|
||||
· ╰────── Expected type `bool`,
|
||||
· │
|
||||
· ╰── but expression is of type `int`
|
||||
───╯
|
1
integration/fail/type-mismatch/while-condition-int.txt
Normal file
1
integration/fail/type-mismatch/while-condition-int.txt
Normal file
|
@ -0,0 +1 @@
|
|||
while 0 {}
|
Reference in a new issue