fez-lisp 1.6.41 → 1.6.42

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 +2 -15
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.6.41",
5
+ "version": "1.6.42",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
package/src/check.js CHANGED
@@ -1116,7 +1116,8 @@ export const typeCheck = (
1116
1116
  if (
1117
1117
  !isUnknownType(actual[STATS]) &&
1118
1118
  !isUnknownType(expected[STATS]) &&
1119
- !equalTypes(actual[STATS], expected[STATS])
1119
+ (!equalTypes(actual[STATS], expected[STATS]) ||
1120
+ !equalSubTypes(actual[STATS], expected[STATS]))
1120
1121
  )
1121
1122
  throw new TypeError(
1122
1123
  `Incorrect type for (${KEYWORDS.ANONYMOUS_FUNCTION}) (${
@@ -1249,20 +1250,6 @@ export const typeCheck = (
1249
1250
  else retry(actual[STATS], exp, stack, checkReturns)
1250
1251
  }
1251
1252
  const checkArgs = () => {
1252
- if (
1253
- !isUnknownReturn(actual[STATS]) &&
1254
- (!equalReturns(expected[STATS], actual[STATS]) ||
1255
- !equalSubReturns(expected[STATS], actual[STATS]))
1256
- )
1257
- throw new TypeError(
1258
- `Incorrect return type for (${
1259
- expected[STATS][SIGNATURE]
1260
- }) Expected (${formatSubType(
1261
- getReturns(expected[STATS])
1262
- )}) but got (${formatSubType(
1263
- getReturns(actual[STATS])
1264
- )}) (${stringifyArgs(exp)}) (check #999)`
1265
- )
1266
1253
  for (let i = 0; i < expected[STATS][ARGUMENTS].length; ++i) {
1267
1254
  const argE = expected[STATS][ARGUMENTS][i]
1268
1255
  const argA = actual[STATS][ARGUMENTS][i]