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
Independently constructing runtime patterns with M matcher methods and defining static types with @typedef is cumbersome and error-prone, leading us to implement manual validation even when M would be useful (cf. Agoric/agoric-sdk#9169 (comment)). It should instead be possible to extract static types from patterns, e.g.
And a version with recursive types (which must be actual TypeScript AFAIK) for recognizing e.g. { version: /** @type {const} */ (1), contents: M.string() } as a Pattern without the need for a wrapping call: TypeScript Playground
What is the Problem Being Solved?
Independently constructing runtime patterns with
M
matcher methods and defining static types with@typedef
is cumbersome and error-prone, leading us to implement manual validation even whenM
would be useful (cf. Agoric/agoric-sdk#9169 (comment)). It should instead be possible to extract static types from patterns, e.g.Description of the Design
Annotate Matcher functions to return annotated values, and define a utility type for reading such annotations into types.
Security Considerations
None AFAIK
Scaling Considerations
None AFAIK
Test Plan
We should take examples from existing endo and agoric-sdk code.
Compatibility Considerations
None AFAIK
Upgrade Considerations
Nothing out of the ordinary, just the usual caveat that functionality is not incorporated into mainnet vats until they are upgraded.
The text was updated successfully, but these errors were encountered: