motoko
motoko copied to clipboard
type operators `and`, `or` are not working right in polymorphic contexts
type Bar<A> = Foo and A
always gives None, even if the A passed in is a record. I didn't test this with or, but I suspect it is equally ignorant with variants in polymorphic context.
That is expected behaviour – these are just syntactic operators, not full-blown union and intersection types (which would introduce exponential complexity into the type system).