Skip to content

Commit d8e52f0

Browse files
committed
update validation section to match text
with regard to requirement to list all transitive possible types, including member interfaces
1 parent ce40773 commit d8e52f0

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

spec/Section 3 -- Type System.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,12 +1462,14 @@ Union types have the potential to be invalid if incorrectly defined.
14621462
2. The member types of a Union type must all be Object, Interface or Union
14631463
types; Scalar and Enum types must not be member types of a Union. Similarly,
14641464
wrapping types must not be member types of a Union.
1465-
3. A parent Union must explicitly include as member types of all child Union
1466-
members.
1465+
3. A Union type must explicitly include all possible types of any included
1466+
abstract types.
14671467
1. Let this union type be {unionType}.
1468-
2. For each {memberType} declared as a member of {unionType}, if {memberType}
1469-
is a Union type, all of the members of {memberType} must also be members
1470-
of {unionType}.
1468+
2. For each {memberType} declared as a member of {unionType}:
1469+
1. If {memberType} is a Union type, all of the members of {memberType}
1470+
must also be members of {unionType}.
1471+
2. If {memberType} is an Interface type, all implementations of
1472+
{memberType} must also be members of {unionType}.
14711473

14721474
### Union Extensions
14731475

@@ -1494,12 +1496,14 @@ Union type extensions have the potential to be invalid if incorrectly defined.
14941496
the original Union type.
14951497
5. Any non-repeatable directives provided must not already apply to the original
14961498
Union type.
1497-
6. A parent Union must explicitly include as member types of all child Union
1498-
members.
1499+
6. A Union type must explicitly include all possible types of any included
1500+
abstract types.
14991501
1. Let this union type be {unionType}.
1500-
2. For each {memberType} declared as a member of {unionType}, if {memberType}
1501-
is a Union type, all of the members of {memberType} must also be members
1502-
of {unionType}.
1502+
2. For each {memberType} declared as a member of {unionType}:
1503+
1. If {memberType} is a Union type, all of the members of {memberType}
1504+
must also be members of {unionType}.
1505+
2. If {memberType} is an Interface type, all implementations of
1506+
{memberType} must also be members of {unionType}.
15031507

15041508
## Enums
15051509

0 commit comments

Comments
 (0)