mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-15 21:23:57 +00:00
Merge branch 'main' into i4717
Signed-off-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
This commit is contained in:
commit
b400851586
17 changed files with 232 additions and 28 deletions
56
crates/compiler/test_mono/generated/issue_4557.txt
Normal file
56
crates/compiler/test_mono/generated/issue_4557.txt
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
procedure Bool.11 (#Attr.2, #Attr.3):
|
||||
let Bool.24 : Int1 = lowlevel Eq #Attr.2 #Attr.3;
|
||||
ret Bool.24;
|
||||
|
||||
procedure Bool.4 (#Attr.2, #Attr.3):
|
||||
let Bool.23 : Int1 = lowlevel Or #Attr.2 #Attr.3;
|
||||
ret Bool.23;
|
||||
|
||||
procedure Test.1 (Test.2, Test.3):
|
||||
let Test.17 : {Int1, Int1} = Struct {Test.2, Test.3};
|
||||
let Test.34 : Int1 = StructAtIndex 0 Test.17;
|
||||
let Test.33 : Int1 = StructAtIndex 1 Test.17;
|
||||
let Test.19 : Int1 = CallByName Test.1 Test.33 Test.34;
|
||||
let Test.27 : {} = Struct {};
|
||||
joinpoint Test.28 Test.21:
|
||||
let Test.23 : {} = Struct {};
|
||||
joinpoint Test.24 Test.22:
|
||||
let Test.20 : Int1 = CallByName Bool.11 Test.21 Test.22;
|
||||
dec Test.22;
|
||||
dec Test.21;
|
||||
let Test.18 : Int1 = CallByName Bool.4 Test.19 Test.20;
|
||||
ret Test.18;
|
||||
in
|
||||
switch Test.33:
|
||||
case 0:
|
||||
let Test.25 : Str = CallByName Test.9 Test.23;
|
||||
jump Test.24 Test.25;
|
||||
|
||||
default:
|
||||
let Test.26 : Str = CallByName Test.11 Test.23;
|
||||
jump Test.24 Test.26;
|
||||
|
||||
in
|
||||
switch Test.34:
|
||||
case 0:
|
||||
let Test.29 : Str = CallByName Test.9 Test.27;
|
||||
jump Test.28 Test.29;
|
||||
|
||||
default:
|
||||
let Test.30 : Str = CallByName Test.11 Test.27;
|
||||
jump Test.28 Test.30;
|
||||
|
||||
|
||||
procedure Test.11 (Test.36):
|
||||
let Test.37 : Str = "a";
|
||||
ret Test.37;
|
||||
|
||||
procedure Test.9 (Test.39):
|
||||
let Test.40 : Str = "a";
|
||||
ret Test.40;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.38 : Int1 = false;
|
||||
let Test.35 : Int1 = true;
|
||||
let Test.13 : Int1 = CallByName Test.1 Test.38 Test.35;
|
||||
ret Test.13;
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
procedure Bool.11 (#Attr.2, #Attr.3):
|
||||
let Bool.23 : Int1 = lowlevel Eq #Attr.2 #Attr.3;
|
||||
ret Bool.23;
|
||||
|
||||
procedure Str.3 (#Attr.2, #Attr.3):
|
||||
let Str.266 : Str = lowlevel StrConcat #Attr.2 #Attr.3;
|
||||
ret Str.266;
|
||||
|
||||
procedure Test.2 (Test.7):
|
||||
let Test.24 : Str = ".trace(\"";
|
||||
let Test.26 : Str = "\")";
|
||||
let Test.25 : Str = CallByName Str.3 Test.7 Test.26;
|
||||
dec Test.26;
|
||||
let Test.23 : Str = CallByName Str.3 Test.24 Test.25;
|
||||
dec Test.25;
|
||||
let Test.22 : [<r>C List *self, C Str] = TagId(1) Test.23;
|
||||
let Test.21 : List [<r>C List *self, C Str] = Array [Test.22];
|
||||
let Test.8 : [<r>C List *self, C Str] = TagId(0) Test.21;
|
||||
let Test.20 : List [<r>C List *self, C Str] = Array [Test.8];
|
||||
let Test.19 : [<r>C List *self, C Str] = TagId(0) Test.20;
|
||||
ret Test.19;
|
||||
|
||||
procedure Test.3 ():
|
||||
let Test.18 : Str = "interface_header";
|
||||
let Test.17 : [<r>C List *self, C Str] = CallByName Test.2 Test.18;
|
||||
ret Test.17;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.14 : [<r>C List *self, C Str] = CallByName Test.3;
|
||||
let Test.16 : Str = "";
|
||||
let Test.15 : [<r>C List *self, C Str] = TagId(1) Test.16;
|
||||
let Test.13 : Int1 = CallByName Bool.11 Test.14 Test.15;
|
||||
dec Test.15;
|
||||
dec Test.14;
|
||||
ret Test.13;
|
||||
|
|
@ -1925,6 +1925,28 @@ fn encode_derived_tag_one_field_string() {
|
|||
)
|
||||
}
|
||||
|
||||
#[mono_test(no_check)]
|
||||
fn polymorphic_expression_unification() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
RenderTree : [
|
||||
Text Str,
|
||||
Indent (List RenderTree),
|
||||
]
|
||||
parseFunction : Str -> RenderTree
|
||||
parseFunction = \name ->
|
||||
last = Indent [Text ".trace(\"\(name)\")" ]
|
||||
Indent [last]
|
||||
|
||||
values = parseFunction "interface_header"
|
||||
|
||||
main = values == Text ""
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn encode_derived_tag_two_payloads_string() {
|
||||
indoc!(
|
||||
|
|
@ -2264,3 +2286,17 @@ fn list_map_take_capturing_or_noncapturing() {
|
|||
"###
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn issue_4557() {
|
||||
indoc!(
|
||||
r###"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
isEqQ = \q1, q2 -> when T q1 q2 is
|
||||
T (U f1) (U f2) -> Bool.or (isEqQ (U f2) (U f1)) (f1 {} == f2 {})
|
||||
|
||||
main = isEqQ (U \{} -> "a") (U \{} -> "a")
|
||||
"###
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue