mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Define inline expects defs in their definition order
When we transform a top-level expect into an inline expect, we collect all intermediate defs before the expect condition, then layer the defs back on. Because the layering procedure builds an expression bottom-up, we must layer on defs in reverse definition order. Closes #4705
This commit is contained in:
parent
935255d06b
commit
42fe19541e
2 changed files with 18 additions and 1 deletions
|
@ -2139,3 +2139,20 @@ fn list_one_vs_one_spread_issue_4685() {
|
|||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test(mode = "test")]
|
||||
fn issue_4705() {
|
||||
indoc!(
|
||||
r###"
|
||||
interface Test exposes [] imports []
|
||||
|
||||
go : {} -> Bool
|
||||
go = \{} -> Bool.true
|
||||
|
||||
expect
|
||||
input = {}
|
||||
x = go input
|
||||
x
|
||||
"###
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue