fez-lisp 1.5.162 → 1.5.164

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.
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.162",
5
+ "version": "1.5.164",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
package/src/check.js CHANGED
@@ -122,7 +122,7 @@ export const castType = (stats, type) => {
122
122
  export const castReturn = (stats, type) => {
123
123
  return (
124
124
  (stats[RETURNS][0] = type[RETURNS][0]),
125
- stats[RETURNS][1] && (stats[RETURNS][1] = type[RETURNS][1])
125
+ type[RETURNS][1] && (stats[RETURNS][1] = type[RETURNS][1])
126
126
  )
127
127
  }
128
128
  export const isGenericReturn = (stats) => stats[RETURNS].length === 3
@@ -1071,7 +1071,7 @@ export const typeCheck = (ast, ctx = SPECIAL_FORM_TYPES) => {
1071
1071
  )}) (${stringifyArgs(exp)}) (check #783)`
1072
1072
  )
1073
1073
  else
1074
- once(
1074
+ retry(
1075
1075
  actual[STATS],
1076
1076
  [[WORD, lambdaName], local],
1077
1077
  stack,
@@ -1729,13 +1729,14 @@ export const typeCheck = (ast, ctx = SPECIAL_FORM_TYPES) => {
1729
1729
  )
1730
1730
  switch (first[VALUE]) {
1731
1731
  case KEYWORDS.IF:
1732
+ if (i === 0)
1733
+ setReturnRef(env[name][STATS], args[i][STATS])
1732
1734
  break
1733
1735
  default:
1734
1736
  // TODO fix this assigment
1735
1737
  // It turns out it's not possible to determine return type of function here
1736
1738
  // what if it's a global function used elsewhere where the return type mwould be different
1737
1739
  // THIS willgive lambda return types but refactor is needed still
1738
- // if (!SPECIAL_FORMS_SET.has(name))
1739
1740
  setReturnRef(env[name][STATS], args[i][STATS])
1740
1741
  break
1741
1742
  }