mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Merge branch 'main' into i5318
Signed-off-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
This commit is contained in:
commit
19c04c69c0
34 changed files with 574 additions and 64 deletions
|
@ -2889,6 +2889,30 @@ fn layout_cache_structure_with_multiple_recursive_structures() {
|
|||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn issue_4770() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
isCorrectOrder { left: IsList [IsInteger 10], right: IsList [IsInteger 20] }
|
||||
|
||||
isCorrectOrder = \pair ->
|
||||
when pair is
|
||||
{ left: IsInteger left, right: IsInteger right } -> left < right
|
||||
{ left: IsList l, right: IsList r } ->
|
||||
if List.map2 l r (\left, right -> { left, right }) |> List.all isCorrectOrder then
|
||||
List.len l < List.len r
|
||||
else
|
||||
Bool.false
|
||||
|
||||
{ left: IsList _, right: IsInteger _ } -> isCorrectOrder { left: pair.left, right: IsList [pair.right] }
|
||||
{ left: IsInteger _, right: IsList _ } -> isCorrectOrder { left: IsList [pair.left], right: pair.right }
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test(allow_type_errors = "true")]
|
||||
fn error_on_erroneous_condition() {
|
||||
indoc!(
|
||||
|
@ -2898,4 +2922,4 @@ fn error_on_erroneous_condition() {
|
|||
main = if True then 1 else 2
|
||||
"#
|
||||
)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue