mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Test aliased unsuffixed effectful function
This commit is contained in:
parent
d22b2a79f5
commit
839078b5d1
1 changed files with 30 additions and 0 deletions
|
@ -14779,4 +14779,34 @@ All branches in an `if` must have the same type!
|
|||
behavior.
|
||||
"###
|
||||
);
|
||||
|
||||
test_report!(
|
||||
aliased_fx_fn,
|
||||
indoc!(
|
||||
r#"
|
||||
app [main!] { pf: platform "../../../../../examples/cli/effects-platform/main.roc" }
|
||||
|
||||
import pf.Effect
|
||||
|
||||
main! = \{} ->
|
||||
printLn "Hello!"
|
||||
|
||||
printLn = Effect.putLine!
|
||||
"#
|
||||
),
|
||||
@r###"
|
||||
── MISSING EXCLAMATION in /code/proj/Main.roc ──────────────────────────────────
|
||||
|
||||
This function is effectful, but its name does not indicate so:
|
||||
|
||||
8│ printLn = Effect.putLine!
|
||||
^^^^^^^
|
||||
|
||||
Add an exclamation mark at the end of its name, like:
|
||||
|
||||
printLn!
|
||||
|
||||
This will help readers identify it as a source of effects.
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue