mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Properly type constrain all function types
This commit is contained in:
parent
20ba4a92de
commit
f857872903
4 changed files with 320 additions and 79 deletions
|
@ -3695,3 +3695,18 @@ fn dec_refcount_for_usage_after_early_return_in_if() {
|
|||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn return_annotated() {
|
||||
indoc!(
|
||||
r#"
|
||||
validateInput : Str -> Result U64 _
|
||||
validateInput = \str ->
|
||||
num = try Str.toU64 str
|
||||
|
||||
Ok num
|
||||
|
||||
validateInput "123"
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue