Skip to content

Array with records of multiple contract type. #781

Answered by yannham
nialov asked this question in Q&A
Discussion options

You must be logged in to vote

The short answer is, you can't in full generality, for good reasons. You can read this blogpost for more details about the consequences of implementing such a generic or operator.

At the end of the post, we gloss over a possible limited or operator that would still be useful, and I imagine it could cover your use case (with Num and Str at least, it depends for more complex contract). To this day, this operator is not implemented, unfortunately.

In the meantime, it can be helpful to define independently the predicates that are used in your contracts, in order to combine them as predicates. What I mean by that is, instead of doing:

let MyComplexContract = fun label value =>
  ... some condi…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@jmgilman
Comment options

@yannham
Comment options

Answer selected by nialov
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants