upload code

This commit is contained in:
Dominic 2022-10-16 20:14:55 +02:00
commit 3f507064ce
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
111 changed files with 9258 additions and 0 deletions

View file

@ -0,0 +1,7 @@
Error: No such field
╭─[assignment-bool-field.txt:2:5]
2 │ foo.bar = true;
· ─┬─
· ╰─── bool is a primitive type and does not have any fields
───╯

View file

@ -0,0 +1,2 @@
let foo: bool = true;
foo.bar = true;

View file

@ -0,0 +1,7 @@
Error: No such field
╭─[assignment-bool-index.txt:2:5]
2 │ foo.0 = true;
· ┬
· ╰── bool is a primitive type and does not have any fields
───╯

View file

@ -0,0 +1,2 @@
let foo: bool = true;
foo.0 = true;

View file

@ -0,0 +1,7 @@
Error: No such field
╭─[assignment-int-field.txt:2:5]
2 │ foo.bar = 1;
· ─┬─
· ╰─── int is a primitive type and does not have any fields
───╯

View file

@ -0,0 +1,2 @@
let foo: int = 1;
foo.bar = 1;

View file

@ -0,0 +1,7 @@
Error: No such field
╭─[assignment-int-index.txt:2:5]
2 │ foo.0 = 1;
· ┬
· ╰── int is a primitive type and does not have any fields
───╯

View file

@ -0,0 +1,2 @@
let foo: int = 1;
foo.0 = 1;

View file

@ -0,0 +1,9 @@
Error: No such field
╭─[assignment-tuple-field.txt:2:5]
2 │ foo.first = 0;
· ──┬──
· ╰──── tuples don't have named fields
·
· Help: To access the first element in a tuple, use `.0`
───╯

View file

@ -0,0 +1,2 @@
let foo: (int,) = (1,);
foo.first = 0;

View file

@ -0,0 +1,9 @@
Error: No such field
╭─[assignment-tuple-out-of-bounds.txt:2:5]
2 │ foo.2 = 0;
· ┬
· ╰── this tuple does not have enough elements
·
· Note: The first element in a tuple has index 0
───╯

View file

@ -0,0 +1,2 @@
let foo: (int,) = (1,);
foo.2 = 0;

View file

@ -0,0 +1,11 @@
Error: Too few arguments
╭─[expected-2-found-1-generic.txt:4:17]
2 │ fn foo<V>(foo: V, bar: V) {}
· ─┬─
· ╰─── This function takes 2 arguments,
·
4 │ let _unit: () = foo::<int>(1);
· ─┬─
· ╰─── but only 1 arguments were supplied
───╯

View file

@ -0,0 +1,4 @@
// This function does nothing.
fn foo<V>(foo: V, bar: V) {}
let _unit: () = foo::<int>(1);

View file

@ -0,0 +1,11 @@
Error: Too few arguments
╭─[expected-2-found-1.txt:4:17]
2 │ fn foo(foo: int, bar: int) {}
· ─┬─
· ╰─── This function takes 2 arguments,
·
4 │ let _unit: () = foo(1);
· ─┬─
· ╰─── but only 1 arguments were supplied
───╯

View file

@ -0,0 +1,4 @@
// This function does nothing.
fn foo(foo: int, bar: int) {}
let _unit: () = foo(1);

View 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`
───╯

View file

@ -0,0 +1,2 @@
let foo: bool = true;
foo = 0;

View file

@ -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`
───╯

View file

@ -0,0 +1,2 @@
let foo: Rc<(bool,)> = Rc((true,));
foo.0 = 0;

View file

@ -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<_>`
───╯

View file

@ -0,0 +1,2 @@
let foo: Rc<(Option<bool>,)> = Rc((None,));
foo.0 = Rc(true);

View file

@ -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`
───╯

View file

@ -0,0 +1 @@
let foo: bool = 1 + 2;

View file

@ -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`
───╯

View file

@ -0,0 +1,2 @@
let one: int = 1;
let foo: bool = -one;

View file

@ -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`
───╯

View file

@ -0,0 +1 @@
let foo: (bool, int) = (true, true);

View 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`
───╯

View file

@ -0,0 +1 @@
let foo: bool = 0;

View file

@ -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`
───╯

View file

@ -0,0 +1 @@
let foo: int = true && true;

View file

@ -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`
───╯

View file

@ -0,0 +1,2 @@
let yes: bool = true;
let foo: int = !yes;

View 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`
───╯

View file

@ -0,0 +1 @@
let foo: int = true;

View file

@ -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`
───╯

View file

@ -0,0 +1 @@
let foo: int = 1 == 2;

View file

@ -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`
───╯

View file

@ -0,0 +1 @@
let foo: (int,) = (true,);

View file

@ -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
───╯

View file

@ -0,0 +1 @@
let foo: () = (1,);

View file

@ -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`
───╯

View file

@ -0,0 +1 @@
let foo: int = 1 + true;

View file

@ -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`
───╯

View file

@ -0,0 +1 @@
let foo: bool = 1 == true;

View file

@ -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`
───╯

View file

@ -0,0 +1 @@
let foo: bool = true || 1;

View 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 `(_, ..)`
───╯

View file

@ -0,0 +1,2 @@
let foo: int = 1;
let bar: int = foo.0;

View 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`
───╯

View file

@ -0,0 +1 @@
let foo: int = -true;

View 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`
───╯

View file

@ -0,0 +1 @@
let foo: bool = !0;

View 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
───╯

View file

@ -0,0 +1 @@
let foo: int = ().0;

View 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`
───╯

View file

@ -0,0 +1 @@
if 0 {}

View 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`
───╯

View file

@ -0,0 +1 @@
while 0 {}

View file

@ -0,0 +1,7 @@
Error: Unknown type
╭─[declaration.txt:1:10]
1 │ let foo: Foo = 0;
· ─┬─
· ╰─── This type has not been defined
───╯

View file

@ -0,0 +1 @@
let foo: Foo = 0;