Properly type constrain all function types

This commit is contained in:
Sam Mohr 2024-11-21 04:09:11 -08:00
parent 20ba4a92de
commit f857872903
No known key found for this signature in database
GPG key ID: EA41D161A3C1BC99
4 changed files with 320 additions and 79 deletions

View file

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