TypeChecking

- Improved formatting of code example
This commit is contained in:
Tristan B. Velloza Kildaire 2023-07-09 14:56:05 +02:00
parent ff87a36951
commit e690dc9619
2 changed files with 8 additions and 2 deletions

View File

@ -199,7 +199,10 @@ What the above code is doing is:
The last line ocnatining an asssertion:
``` d
assert(isSameType(variableDeclarationType, assignmentInstr.getInstrType())); // Sanity check
assert(isSameType(
variableDeclarationType,
assignmentInstr.getInstrType()
); // Sanity check
```
This is a sanity check, as if the type coercion failed then an exception

View File

@ -281,7 +281,10 @@ What the above code is doing is:
The last line ocnatining an asssertion:
```{.d .numberLines}
assert(isSameType(variableDeclarationType, assignmentInstr.getInstrType())); // Sanity check
assert(isSameType(
variableDeclarationType,
assignmentInstr.getInstrType()
); // Sanity check
```
This is a sanity check, as if the type coercion failed then an exception would be thrown and the assertion would not be reached, however if the types were an exact match **or** if they were not but could be coerced as such then the two types should match.