Merge pull request #4882 from roc-lang/weakening-3

Begin weakening let-bindings to non-function, non-number expressions
This commit is contained in:
Folkert de Vries 2023-01-14 15:32:27 +01:00 committed by GitHub
commit e3a213c0dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 129 additions and 60 deletions

View file

@ -3349,12 +3349,12 @@ fn monomorphized_lists() {
assert_evals_to!(
indoc!(
r#"
l = [1, 2, 3]
l = \{} -> [1, 2, 3]
f : List U8, List U16 -> Nat
f = \_, _ -> 18
f l l
f (l {}) (l {})
"#
),
18,
@ -3461,11 +3461,11 @@ fn issue_3530_uninitialized_capacity_in_list_literal() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_let_generalization() {
fn list_infer_usage() {
assert_evals_to!(
indoc!(
r#"
empty : List a
empty : List _
empty = []
xs : List Str

View file

@ -3418,7 +3418,9 @@ fn polymorphic_lambda_set_multiple_specializations() {
r#"
id1 = \x -> x
id2 = \y -> y
id = if Bool.true then id1 else id2
id = \z ->
f = if Bool.true then id1 else id2
f z
(id 9u8) + Num.toU8 (id 16u16)
"#