A type system with polymorphic variants based on sub typing