tobogganSe connecter

louise

The Louise language: compiler, runtime, std, tooling

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

43 lignes · 827 octetsBrut · Historique
1// One broken item must not hide the types of the others.
2
3import std/actor
4
5fn before :: x
6{
7 x + 1
8}
9//~ TYPE before: fn(Int) -> Int
10
11pub fn broken :: -> Int
12{
13 undefined_thing + "text" //~ ERROR E0101 no value named `undefined_thing`
14}
15
16fn after :: xs
17{
18 [0, ..xs]
19}
20//~ TYPE after: fn(List<Int>) -> List<Int>
21
22fn uses_broken ::
23{
24 broken () + 1
25}
26//~ TYPE uses_broken: fn() -> Int
27
28// An effect that is not in scope is reported once, where the row names it,
29// not again at every call that performs it (issue #144).
30fn start ::
31 -> () / <proc> //~ ERROR E0505 no effect named `proc` is in scope
32{
33 let counter = actor.start 0 fn n _ { actor.Continue(n) }
34 actor.cast counter 1
35 actor.cast counter 2
36}
37
38fn starts_twice :: -> () / <proc>
39//~^ ERROR E0505 no effect named `proc` is in scope
40{
41 start ()
42 start ()
43}