You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type t = private {
keys: Webapi__Iterator.t<string>,
values: Webapi__Iterator.t<EntryValue.t>,
entries: Webapi__Iterator.t<(string, EntryValue.t)>,
}
...
@send external keys: t => Webapi__Iterator.t<string> = "keys"
@send external values: t => Webapi__Iterator.t<EntryValue.t> = "values"
@send external entries: t => Webapi__Iterator.t<(string, EntryValue.t)> = "entries"
Notice that keys(), values(), and entries() are nullary methods, not getters. Exposing record fields like keys: Webapi__Iterator.t<string> is incorrect because those are not the correct types. This type should be reverted back to an abstract type.
In theory the record fields could be defined as functions, but in my experience calling a record function always generates a Curry call at runtime. So I agree the type should revert to abstract.
It is currently defined as:
Notice that
keys()
,values()
, andentries()
are nullary methods, not getters. Exposing record fields likekeys: Webapi__Iterator.t<string>
is incorrect because those are not the correct types. This type should be reverted back to an abstract type.Relates to #2
The text was updated successfully, but these errors were encountered: