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.
Dernier runRéussi#115 · main · 21 min 41 s
0Étoiles
0Forks
40Issues
| 1 | // One broken item must not hide the types of the others. |
| 2 | |
| 3 | import std/actor |
| 4 | |
| 5 | fn before :: x |
| 6 | { |
| 7 | x + 1 |
| 8 | } |
| 9 | //~ TYPE before: fn(Int) -> Int |
| 10 | |
| 11 | pub fn broken :: -> Int |
| 12 | { |
| 13 | undefined_thing + "text" //~ ERROR E0101 no value named `undefined_thing` |
| 14 | } |
| 15 | |
| 16 | fn after :: xs |
| 17 | { |
| 18 | [0, ..xs] |
| 19 | } |
| 20 | //~ TYPE after: fn(List<Int>) -> List<Int> |
| 21 | |
| 22 | fn 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). |
| 30 | fn 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 | |
| 38 | fn starts_twice :: -> () / <proc> |
| 39 | //~^ ERROR E0505 no effect named `proc` is in scope |
| 40 | { |
| 41 | start () |
| 42 | start () |
| 43 | } |