Add test for when ability specialization is unused

This commit is contained in:
Ayaz Hafiz 2022-07-25 12:23:22 -04:00
parent 254d684dfa
commit b0102a8ae7
No known key found for this signature in database
GPG Key ID: 0E2A37416A25EF58

View File

@ -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.
"###
);
}