forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasync_inline.res
48 lines (38 loc) · 1.03 KB
/
async_inline.res
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
let willBeInlined = async () => 3
let inlined = willBeInlined ()
let wrapSomethingAsync: unit => unit = () => {
let _ = (
async (_) => {
let test = await Js.Promise.resolve("Test")
Js.log(test)
}
)(777)
}
external ignorePromise: promise<'a> => unit = "%identity"
let wrapSomethingAsync2 = () =>
(
async () => {
let test = await Js.Promise.resolve("Test")
Js.log(test)
}
)()->ignorePromise
module M: {
let broken: (unit => promise<'a>) => promise<'a>
} = {
let doSomethingAsync = async (someAsyncFunction) => {
await someAsyncFunction()
}
let broken = someAsyncFunction => doSomethingAsync(someAsyncFunction)
}
let broken = async (someAsyncFunction) => {
await someAsyncFunction()
}
let broken = someAsyncFunction => broken(someAsyncFunction)
let curriedId = x => x
let curriedIdAsync = async x => x
let uncurriedId = (.x ) => x
let uncurriedIdAsync = async (.x ) => x
let tci = curriedId(3)
let tcia = curriedIdAsync(3)
let tui = uncurriedId(. 3)
let tuia = uncurriedIdAsync(. 3)