aesophia icon indicating copy to clipboard operation
aesophia copied to clipboard

Consider `is` operator to check variant of datatypes

Open marc0olo opened this issue 2 years ago • 1 comments

as discussed in chat.

given datatype metadata = MetadataIdentifier(string) | MetadataMap(map(string, string)) it could be helpful to easily check if a value is of variant MetadataIdentifier or MetadataMap

marc0olo avatar Oct 31 '22 07:10 marc0olo

the discussion popped up when implementing these lines of code which could be replaced with a require then:

  • https://github.com/aeternity/aex141-nft-collection-example/blob/e4d8190519d8a2ac3381f0ecd753b3716a030ce1/contracts/CollectionTemplateEditionNFTs.aes#L174

marc0olo avatar Oct 31 '22 07:10 marc0olo