You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method is is fairly ambiguous, since it could mean "equivalence" (= $other is actually the exact same type) or "implication" (= $other is a sub-type of $this).
An alternative name for isSuperTypeOf would be implies. The interface could also reverse the direction of query and have a method isSubTypeOf (or: isImpliedBy). Personally, I'm indifferent to either of these, but would strictly opt for having only one of those methods.
The rules for the built-in types in regards to isSuperTypeOf should be as follows:
Built-in Type
isSuperTypeOf($other) when...
BooleanType
equals($other)
ComponentType
equals($other)
EnumStaticType
equals($other)
EnumType
equals($other)
NumberType
equals($other)
SlotType
equals($other) or $other is one of: StringType, ComponentType
StringType
equals($other)
StructType
equals($other)
UnionType
equals($other) or $other is UnionType with fewer, but compatible members, or $other is any member type of this union
The text was updated successfully, but these errors were encountered:
The
TypeInterface
currently looks like this:The method
is
is fairly ambiguous, since it could mean "equivalence" (=$other
is actually the exact same type) or "implication" (=$other
is a sub-type of$this
).So, I'd suggest to change the interface thusly:
An alternative name for
isSuperTypeOf
would beimplies
. The interface could also reverse the direction of query and have a methodisSubTypeOf
(or:isImpliedBy
). Personally, I'm indifferent to either of these, but would strictly opt for having only one of those methods.The rules for the built-in types in regards to
isSuperTypeOf
should be as follows:isSuperTypeOf($other)
when...BooleanType
equals($other)
ComponentType
equals($other)
EnumStaticType
equals($other)
EnumType
equals($other)
NumberType
equals($other)
SlotType
equals($other)
or$other
is one of:StringType
,ComponentType
StringType
equals($other)
StructType
equals($other)
UnionType
equals($other)
or$other
isUnionType
with fewer, but compatible members, or$other
is any member type of this unionThe text was updated successfully, but these errors were encountered: