mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Able variables through different functions compile
This commit is contained in:
parent
a07323fb40
commit
b9f79fdd31
2 changed files with 27 additions and 0 deletions
|
@ -84,3 +84,26 @@ fn alias_member_specialization() {
|
|||
u64
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ability_constrained_in_non_member_usage() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [ result ] to "./platform"
|
||||
|
||||
Hash has
|
||||
hash : a -> U64 | a has Hash
|
||||
|
||||
mulHashes = \x, y -> hash x * hash y
|
||||
|
||||
Id := U64
|
||||
hash = \$Id n -> n
|
||||
|
||||
result = mulHashes ($Id 5) ($Id 7)
|
||||
"#
|
||||
),
|
||||
35,
|
||||
u64
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue