From 9e0e2a04c9c01b6a62eb4b3dfa4a93956207f380 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Sat, 8 Jul 2023 12:19:03 +0200 Subject: [PATCH] Post-proc --- docs/implementation/35-typechecking.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/implementation/35-typechecking.md b/docs/implementation/35-typechecking.md index 577a39d..9e3a41c 100644 --- a/docs/implementation/35-typechecking.md +++ b/docs/implementation/35-typechecking.md @@ -112,9 +112,20 @@ $type_{i}$. An optional flag can be passed such that if the $typeof(instr_{i}) \neq type_{i}$ that it can then attempt coercion as to bring it to the equal type. -#### TODO: isSameType +The method by which this is done is: -TODO: Document isSameTYpe +``` d +typeEnforce(Type toType, Value v2, ref Instruction coercedInstruction, bool allowCoercion = false) +``` + +#### Type equality + +In order to check strict equality the type enforcer will initially check +the following condition. We label the `toType` as $t_{1}$ and the the +type of `v2` as $typeof(v_{2})$ (otherwise referred to as $t_{2}$). + +The method `isSameType(Type t1, Type t2)` provides exact quality +checking between the two given types in the form of $t_{1} = t_{2}$. #### Coercion