Description:
In several places, the operation of intersecting types is mentioned (for the first time in section 6.2.2, Contextually expected type). True, the statement "A type denotes a set of shapes" (5. Values, Types and Variables) might suffice for a definition, but Ballerina's type concept is very subtle, and I think a given set of shapes is not yet equivalent to a named type. (For example, I am not sure if a union type with a single member type is identical to that member type.) And I wonder what intersection might mean in "practical" (describable) terms if the participating types are not union types. So my suggestion is to introduce an explicit definition of type intersection and possibly also add a note illustrating the concept with examples. The best place would probably be section 5. Values, Types and Variables.
Description: In several places, the operation of intersecting types is mentioned (for the first time in section 6.2.2, Contextually expected type). True, the statement "A type denotes a set of shapes" (5. Values, Types and Variables) might suffice for a definition, but Ballerina's type concept is very subtle, and I think a given set of shapes is not yet equivalent to a named type. (For example, I am not sure if a union type with a single member type is identical to that member type.) And I wonder what intersection might mean in "practical" (describable) terms if the participating types are not union types. So my suggestion is to introduce an explicit definition of type intersection and possibly also add a note illustrating the concept with examples. The best place would probably be section 5. Values, Types and Variables.
Suggested Labels: Type intersection