fez-lisp 1.5.154 → 1.5.155

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 -33
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.154",
5
+ "version": "1.5.155",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
package/src/check.js CHANGED
@@ -327,17 +327,6 @@ const IsPredicate = (leaf) =>
327
327
  (PREDICATES_OUTPUT_SET.has(leaf[VALUE]) ||
328
328
  getSuffix(leaf[VALUE]) === PREDICATE_SUFFIX))
329
329
 
330
- // THese should also check if sub type is Uknown array and pass as ok
331
- const notABooleanType = (a, b) => {
332
- return (
333
- hasSubType(a) &&
334
- getSubType(a).has(BOOLEAN) &&
335
- !isUnknownType(b) &&
336
- !isAnyType(b) &&
337
- ((!hasSubType(b) && getType(b) !== COLLECTION) ||
338
- (hasSubType(b) && getSubType(a).difference(getSubType(b)).size !== 0))
339
- )
340
- }
341
330
  const equalSubTypes = (a, b) => {
342
331
  return (
343
332
  !hasSubType(a) ||
@@ -371,24 +360,6 @@ const equalSubTypesWithSubReturn = (a, b) => {
371
360
  getSubType(a).difference(getSubReturn(b)).size === 0
372
361
  )
373
362
  }
374
- const notABooleanTypeWithReturn = (a, b) => {
375
- return (
376
- hasSubType(a) &&
377
- getSubType(a).has(BOOLEAN) &&
378
- !isUnknownReturn(b) &&
379
- !isAnyReturn(b) &&
380
- (!hasSubReturn(b) || getSubType(a).difference(getSubReturn(b)).size !== 0)
381
- )
382
- }
383
- const notABooleanReturn = (a, b) => {
384
- return (
385
- hasSubReturn(a) &&
386
- getSubReturn(a).has(BOOLEAN) &&
387
- !isUnknownReturn(b) &&
388
- !isAnyReturn(b) &&
389
- (!hasSubReturn(b) || getSubReturn(a).difference(getSubReturn(b)).size !== 0)
390
- )
391
- }
392
363
  const isAtomABoolean = (atom) => atom === TRUE || atom === FALSE
393
364
  const checkPredicateName = (exp, rest) => {
394
365
  if (getSuffix(rest[0][VALUE]) === PREDICATE_SUFFIX) {
@@ -1020,7 +991,7 @@ export const typeCheck = (ast) => {
1020
991
  getReturn(actual[STATS])
1021
992
  )}) (${stringifyArgs(exp)}) (check #779)`
1022
993
  )
1023
- else if (notABooleanReturn(expected[STATS], actual[STATS]))
994
+ else if (!eualSubReturn(expected[STATS], actual[STATS]))
1024
995
  throw new TypeError(
1025
996
  `Incorrect return type for (${
1026
997
  expected[STATS][SIGNATURE]
@@ -1065,9 +1036,7 @@ export const typeCheck = (ast) => {
1065
1036
  getType(actual[STATS])
1066
1037
  )}) (${stringifyArgs(exp)}) (check #780)`
1067
1038
  )
1068
- else if (
1069
- notABooleanReturn(expected[STATS], actual[STATS])
1070
- )
1039
+ else if (!eualSubReturn(expected[STATS], actual[STATS]))
1071
1040
  throw new TypeError(
1072
1041
  `Incorrect return type for (${
1073
1042
  expected[STATS][SIGNATURE]