From 1aae244ece57394bd9edce4be08c192487308711 Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Thu, 28 Jul 2022 05:05:57 +0300 Subject: [PATCH 1/4] Clarify current ResolveAbstractType algorithm add assertions from reference implementation --- spec/Section 6 -- Execution.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/spec/Section 6 -- Execution.md b/spec/Section 6 -- Execution.md index 5bde7a6c1..0ea9755b3 100644 --- a/spec/Section 6 -- Execution.md +++ b/spec/Section 6 -- Execution.md @@ -891,9 +891,22 @@ the {objectValue}. ResolveAbstractType(abstractType, objectValue): -- Return the result of calling the internal method provided by the type system - for determining the Object type of {abstractType} given the value - {objectValue}. +- Let {resolvedType} be the result of calling the internal method provided by + the type system for determining the Object type of {abstractType} given the + value {objectValue}. +- Assert {resolvedType} is an Object type. +- If {IsSubType(abstractType, resolvedType)}: + - Return {resolvedType}. +- Otherwise, raise a field error. + +IsSubType(superType, maybeSubType): + +- If {abstractType} is an Interface type. + - If {resolvedType} implements {abstractType}, return {true}. + - Otherwise, return {false}. +- If {abstractType} is a Union type. + - If {resolvedType} is a member type of {abstractType}, return {true}. + - Otherwise, return {false}. ### Handling Execution Errors From c653f45d272ccb2f43a3cf79f981ae6836e38622 Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Thu, 28 Jul 2022 14:28:55 +0300 Subject: [PATCH 2/4] Update spec/Section 6 -- Execution.md Co-authored-by: Benjie Gillam --- spec/Section 6 -- Execution.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/Section 6 -- Execution.md b/spec/Section 6 -- Execution.md index 0ea9755b3..8a8b6b571 100644 --- a/spec/Section 6 -- Execution.md +++ b/spec/Section 6 -- Execution.md @@ -895,9 +895,8 @@ ResolveAbstractType(abstractType, objectValue): the type system for determining the Object type of {abstractType} given the value {objectValue}. - Assert {resolvedType} is an Object type. -- If {IsSubType(abstractType, resolvedType)}: - - Return {resolvedType}. -- Otherwise, raise a field error. +- Assert {IsSubType(abstractType, resolvedType)}. +- Return {resolvedType}. IsSubType(superType, maybeSubType): From b7b0163af0e9ae9964b150dae2d90f4818668a00 Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Thu, 28 Jul 2022 14:35:45 +0300 Subject: [PATCH 3/4] correct mistaken argument names --- spec/Section 6 -- Execution.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/Section 6 -- Execution.md b/spec/Section 6 -- Execution.md index 8a8b6b571..b274e548c 100644 --- a/spec/Section 6 -- Execution.md +++ b/spec/Section 6 -- Execution.md @@ -898,13 +898,13 @@ ResolveAbstractType(abstractType, objectValue): - Assert {IsSubType(abstractType, resolvedType)}. - Return {resolvedType}. -IsSubType(superType, maybeSubType): +IsSubType(abstractType, objectType): - If {abstractType} is an Interface type. - - If {resolvedType} implements {abstractType}, return {true}. + - If {objectType} implements {abstractType}, return {true}. - Otherwise, return {false}. - If {abstractType} is a Union type. - - If {resolvedType} is a member type of {abstractType}, return {true}. + - If {objectType} is a member type of {abstractType}, return {true}. - Otherwise, return {false}. ### Handling Execution Errors From fe29907614385eeee22106cbc62b11c407c3e8ab Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Fri, 6 Mar 2026 01:41:05 +0200 Subject: [PATCH 4/4] fix formatting --- spec/Section 6 -- Execution.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/Section 6 -- Execution.md b/spec/Section 6 -- Execution.md index b274e548c..f89d3940f 100644 --- a/spec/Section 6 -- Execution.md +++ b/spec/Section 6 -- Execution.md @@ -894,8 +894,8 @@ ResolveAbstractType(abstractType, objectValue): - Let {resolvedType} be the result of calling the internal method provided by the type system for determining the Object type of {abstractType} given the value {objectValue}. -- Assert {resolvedType} is an Object type. -- Assert {IsSubType(abstractType, resolvedType)}. +- Assert: {resolvedType} is an Object type. +- Assert: {IsSubType(abstractType, resolvedType)}. - Return {resolvedType}. IsSubType(abstractType, objectType):