deeplyFulfilled erases type information
https://github.com/endojs/endo/blob/master/packages/marshal/src/deeplyFulfilled.js#L36-L39
https://github.com/endojs/endo/blob/master/packages/marshal/src/types.js#L26
Because Passable is any, the type passed into deeplyFulfilled gets erased. The decision to adopt bare deeplyFulfilled in https://github.com/Agoric/agoric-sdk/pull/5891/commits/a8db35404777d1f9e385a7ce9ba1add827e4cff6 has erased type information there. Example impact: I just had a CI failure from a refactoring that the types would have alerted me to.
This week I sort of got bit by this.
The type-safe alternative, deeplyFulfilledObject, didn't work out either, though:
https://github.com/Agoric/agoric-sdk/pull/6774/commits/eb26cb200f2c68d8a636380c871090fe4468f67fb3
part of:
- https://github.com/Agoric/agoric-sdk/pull/6774
Not directly relevant, but worth linking to: https://github.com/Agoric/agoric-sdk/pull/6816
May be solved by bringing these types over from sdk, https://github.com/Agoric/agoric-sdk/blob/master/packages/internal/src/utils.js#L160-L168
Would #1933 address this issue?
Would #1933 address this issue?
No, because the return type still widens to Passable. We need the function to be generic on its parameters.