mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-13 09:49:11 +03:00
Add test for when ability specialization is unused
This commit is contained in:
parent
254d684dfa
commit
b0102a8ae7
@ -10063,4 +10063,30 @@ All branches in an `if` must have the same type!
|
||||
program's behavior!
|
||||
"###
|
||||
);
|
||||
|
||||
test_report!(
|
||||
unused_shadow_specialization,
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [hash, Id] to "./platform"
|
||||
|
||||
Hash has hash : a -> U64 | a has Hash
|
||||
|
||||
Id := {}
|
||||
|
||||
hash = \@Id _ -> 0
|
||||
"#
|
||||
),
|
||||
@r###"
|
||||
── UNUSED DEFINITION ───────────────────────────────────── /code/proj/Main.roc ─
|
||||
|
||||
`hash` is not used anywhere in your code.
|
||||
|
||||
7│ hash = \@Id _ -> 0
|
||||
^^^^
|
||||
|
||||
If you didn't intend on using `hash` then remove it so future readers of
|
||||
your code don't wonder why it is there.
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user