Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit fcd3c32

Browse files
author
Maxim
committed
Add extra test case for async arrow expressions in ternary true branches
1 parent 41844e6 commit fcd3c32

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

tests/parsing/grammar/expressions/async.res

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ let async = {
2424
{async: async[async]}
2525

2626
result->async->mapAsync(a => doStuff(a))
27-
}
27+
}
28+
29+
let f = isPositive ? (async (a, b) : int => a + b) : async (c, d) : int => c - d

tests/parsing/grammar/expressions/expected/async.res.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,9 @@ let async =
2020
async.async;
2121
{ async = (async.(async)) };
2222
(result |. async) |. (mapAsync (fun a -> doStuff a)))
23-
[@ns.braces ])
23+
[@ns.braces ])
24+
let f =
25+
((if isPositive
26+
then ((fun a -> fun b -> (a + b : int))[@res.async ])
27+
else (((fun c -> fun d -> (c - d : int)))[@res.async ]))
28+
[@ns.ternary ])

0 commit comments

Comments
 (0)