Essentially, we can implement MyTrait multiple ways and allow MyDataType to take in any of them (like we would with an interface in other languages). Although VSCode codes not (currently) show any errors, when compiling I get error : compilation does not support trait types as a type parameter; consider introducing a ghost
I was hoping this functionality could be supported, so we don't need to create custom
datatype MyDataTypeForMyTrait<T> = SomeValue(value: MyTrait) | NoValue(msg: string)
For every custom trait we create
Currently, we have a custom
datatype MyDataType<T> = SomeValue(value: T) | NoValue(msg: string)
I wanted to have a custom trait, like
Essentially, we can implement
MyTrait
multiple ways and allowMyDataType
to take in any of them (like we would with an interface in other languages). Although VSCode codes not (currently) show any errors, when compiling I geterror : compilation does not support trait types as a type parameter; consider introducing a ghost
I was hoping this functionality could be supported, so we don't need to create custom
datatype MyDataTypeForMyTrait<T> = SomeValue(value: MyTrait) | NoValue(msg: string)
For every custom trait we create