@@ -726,7 +726,7 @@ section "Type declarations" {
726726 types may not appear in a union type.'''
727727 }
728728
729- Static_Semantics Union_Type_No_Field_Access {
729+ Static_Semantics Union_Type_Field_Access_Validity {
730730 text = '''A field access on a component with a union type is
731731 permitted if the field exists (by name) in at least one
732732 member type. If the field does not exist in any member
@@ -735,7 +735,7 @@ section "Type declarations" {
735735
736736 Static_Semantics Union_Type_Field_Access {
737737 text = '''When field access on a union-typed component is
738- permitted (see Union_Type_No_Field_Access ), the static
738+ permitted (see Union_Type_Field_Access_Validity ), the static
739739 type of the resulting expression is the declared type of
740740 that field in the member types that contain it. This
741741 type must be identical across all members that declare
@@ -779,6 +779,17 @@ section "Type declarations" {
779779 structural equality)*.'''
780780 }
781781
782+ Static_Semantics Union_Type_Equality_Domain {
783+ text = '''An equality or inequality operator applied to a union-typed
784+ component requires the other operand to have a compatible
785+ type. An operand type T is compatible with a union type U
786+ if T is one of the member types of U, or T is a (transitive)
787+ extension of a member type of U, or one of the member types
788+ of U is a (transitive) extension of T. If no such
789+ compatibility exists between the two operands, it is a
790+ static error.'''
791+ }
792+
782793 Static_Semantics Anonymous_Arrays {
783794 text = '''A component with an array declaration introduces an
784795 anonymous array type. This means the type of
0 commit comments