Open njordhov opened 4 years ago
this would have the advantage of not requiring a special syntax to identify traits, i.e. <can-sell>
I like this syntax. It would also be easy to specify multiple traits (e.g. (principal can-sell can-auction)
), instead of having to create a new trait that combines multiple traits.
Principal refinement types refine the native Principal type with optional traits.
Refined types of principals are declared to implement the specific traits, benefiting static analysis. They are similar to the Integer refinement types proposed in issue #13, the String refinement types proposed in #19, and the List type refined with an entry-type. They are suited to be used for the type aliases proposed in issue #6.
Example:
Related: https://github.com/blockstack/stacks-blockchain/pull/1679