Skip to content

Commit

Permalink
Add IsValidImplementationFieldType updates
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Jan 3, 2024
1 parent 8395fd5 commit bd038f2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -953,16 +953,23 @@ IsValidImplementationFieldType(fieldType, implementedFieldType):
1. If {fieldType} is a Non-Null type:
1. Let {nullableType} be the unwrapped nullable type of {fieldType}.
2. Let {implementedNullableType} be the unwrapped nullable type of
{implementedFieldType} if it is a Non-Null type, otherwise let it be
{implementedFieldType} directly.
{implementedFieldType} if it is a Non-Null type or Semantic-Non-Null type,
otherwise let it be {implementedFieldType} directly.
3. Return {IsValidImplementationFieldType(nullableType,
implementedNullableType)}.
2. If {fieldType} is a List type and {implementedFieldType} is also a List type:
2. If {fieldType} is a Semantic-Non-Null type:
1. Let {nullableType} be the unwrapped nullable type of {fieldType}.
2. Let {implementedNullableType} be the unwrapped nullable type of
{implementedFieldType} if it is a Semantic-Non-Null type, otherwise let it
be {implementedFieldType} directly.
3. Return {IsValidImplementationFieldType(nullableType,
implementedNullableType)}.
3. If {fieldType} is a List type and {implementedFieldType} is also a List type:
1. Let {itemType} be the unwrapped item type of {fieldType}.
2. Let {implementedItemType} be the unwrapped item type of
{implementedFieldType}.
3. Return {IsValidImplementationFieldType(itemType, implementedItemType)}.
3. Return {IsSubType(fieldType, implementedFieldType)}.
4. Return {IsSubType(fieldType, implementedFieldType)}.

IsSubType(possibleSubType, superType):

Expand Down

0 comments on commit bd038f2

Please sign in to comment.