-
Notifications
You must be signed in to change notification settings - Fork 471
Milestone
Description
I'm struggling to combine @this
with an async keyword to return a promise:
type pluginContext
type changeEvent
type p = {
watch: @this (pluginContext, string, changeEvent) => promise<unit>
}
let p1 = {
watch: @this async (pc, name, ev) => {
()
}
}
Type Errors
[E] Line 9, column 22:
This has type:
Js_OO.Callback.arity3<(pluginContext, string, changeEvent) => unit>
But the record field watch is expected to have type:
Js_OO.Callback.arity3<(pluginContext, string, changeEvent) => promise<unit>>
The incompatible parts:
unit vs promise<unit>
My syntax could be off, but I wonder if we support this.
@cristianoc do you have any ideas?
Metadata
Metadata
Assignees
Labels
No labels