fez-lisp 1.5.82 → 1.5.83

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.82",
5
+ "version": "1.5.83",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
package/src/check.js CHANGED
@@ -680,19 +680,35 @@ export const typeCheck = (ast) => {
680
680
  const alternative = isLeaf(re[1])
681
681
  ? copy[re[1][VALUE]]
682
682
  : copy[re[1][0][VALUE]]
683
+
683
684
  // todo check if condition matches alternative
685
+ // TODO make this more simple - it's so many different things just because types are functions or not
686
+ // WHY not consiter making return types for everything
684
687
  if (
685
688
  concequent &&
686
- concequent[STATS][RETURNS][0] !== UNKNOWN
689
+ concequent[STATS][TYPE_PROP][0] !== UNKNOWN
687
690
  ) {
688
- ref[STATS][RETURNS] = concequent[STATS][RETURNS]
691
+ if (concequent[STATS][TYPE_PROP][0] === APPLY)
692
+ ref[STATS][RETURNS] = concequent[STATS][RETURNS]
693
+ else
694
+ ref[STATS][RETURNS] =
695
+ concequent[STATS][TYPE_PROP]
689
696
  } else if (
690
697
  alternative &&
691
- alternative[STATS][RETURNS][0] !== UNKNOWN
698
+ alternative[STATS][TYPE_PROP][0] !== UNKNOWN
692
699
  ) {
693
- ref[STATS][RETURNS] = alternative[STATS][RETURNS]
700
+ if (alternative[STATS][TYPE_PROP][0] === APPLY)
701
+ ref[STATS][RETURNS] =
702
+ alternative[STATS][RETURNS]
703
+ else
704
+ ref[STATS][RETURNS] =
705
+ alternative[STATS][TYPE_PROP]
694
706
  } else if (concequent) {
695
- ref[STATS][RETURNS] = concequent[STATS][RETURNS]
707
+ if (concequent[STATS][TYPE_PROP][0] === APPLY)
708
+ ref[STATS][RETURNS] = concequent[STATS][RETURNS]
709
+ else
710
+ ref[STATS][RETURNS] =
711
+ concequent[STATS][TYPE_PROP]
696
712
  }
697
713
  }
698
714