Skip to content

Commit a2d03d1

Browse files
committed
Clarify current ResolveAbstractType algorithm
add assertions from reference implementation
1 parent 47a6bfd commit a2d03d1

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

spec/Section 6 -- Execution.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -734,9 +734,22 @@ the {objectValue}.
734734

735735
ResolveAbstractType(abstractType, objectValue):
736736

737-
- Return the result of calling the internal method provided by the type system
738-
for determining the Object type of {abstractType} given the value
739-
{objectValue}.
737+
- Let {resolvedType} be the result of calling the internal method provided by
738+
the type system for determining the Object type of {abstractType} given the
739+
value {objectValue}.
740+
- Assert {resolvedType} is an Object type.
741+
- If {IsSubType(abstractType, resolvedType)}:
742+
- Return {resolvedType}.
743+
- Otherwise, raise a field error.
744+
745+
IsSubType(superType, maybeSubType):
746+
747+
- If {abstractType} is an Interface type.
748+
- If {resolvedType} implements {abstractType}, return {true}.
749+
- Otherwise, return {false}.
750+
- If {abstractType} is a Union type.
751+
- If {resolvedType} is a member type of {abstractType}, return {true}.
752+
- Otherwise, return {false}.
740753

741754
**Merging Selection Sets**
742755

0 commit comments

Comments
 (0)