mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Merge pull request #4882 from roc-lang/weakening-3
Begin weakening let-bindings to non-function, non-number expressions
This commit is contained in:
commit
e3a213c0dc
10 changed files with 129 additions and 60 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
"#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue