fez-lisp 1.5.111 → 1.5.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/check.js +8 -1
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "fez-lisp",
3
3
  "description": "Lisp interpreted & compiled to JavaScript",
4
4
  "author": "AT290690",
5
- "version": "1.5.111",
5
+ "version": "1.5.112",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
package/src/check.js CHANGED
@@ -847,7 +847,14 @@ export const typeCheck = (ast, error = true) => {
847
847
  if (!isResLeaf) {
848
848
  const name = rest[i][0][VALUE]
849
849
  if (!env[name]) continue
850
- if (
850
+ if (name === KEYWORDS.IF) {
851
+ const concequent = [...rest]
852
+ const alternative = [...rest]
853
+ concequent[i] = rest[i][1]
854
+ alternative[i] = rest[i][2]
855
+ check([first, ...concequent], env, scope)
856
+ check([first, ...alternative], env, scope)
857
+ } else if (
851
858
  !isUnknownReturn(env[name][STATS]) &&
852
859
  !compareTypeWithReturn(args[i][STATS], env[name][STATS])
853
860
  )