fez-lisp 1.5.92 → 1.5.93
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 +1 -1
- package/src/check.js +9 -17
package/package.json
CHANGED
package/src/check.js
CHANGED
@@ -80,6 +80,10 @@ export const setReturnToTypeRef = (stats, value) => {
|
|
80
80
|
// if (!isAnyReturn(stats) && !isAnyReturn(value))
|
81
81
|
if (isUnknownReturn(stats)) stats[RETURNS] = value[TYPE_PROP]
|
82
82
|
}
|
83
|
+
export const setTypeToReturnRef = (stats, value) => {
|
84
|
+
// if (!isAnyReturn(stats) && !isAnyReturn(value))
|
85
|
+
if (isUnknownType(stats)) stats[TYPE_PROP] = value[RETURNS]
|
86
|
+
}
|
83
87
|
export const setPropRef = (stats, prop, value) => {
|
84
88
|
// if (stats[prop][0] !== ANY && value[prop][0] !== ANY)
|
85
89
|
if (stats[prop][0] === UNKNOWN) stats[prop] = value[prop]
|
@@ -624,19 +628,10 @@ export const typeCheck = (ast, error = true) => {
|
|
624
628
|
// TODO figure out what we do here
|
625
629
|
// this here is a variable WORD
|
626
630
|
// so return type of that function is that varible type
|
627
|
-
|
628
|
-
|
629
|
-
ref[STATS],
|
630
|
-
|
631
|
-
)
|
632
|
-
else
|
633
|
-
stack.push(() => {
|
634
|
-
if (copy[returns[VALUE]])
|
635
|
-
setReturnToTypeRef(
|
636
|
-
ref[STATS],
|
637
|
-
copy[returns[VALUE]][STATS]
|
638
|
-
)
|
639
|
-
})
|
631
|
+
stack.push(() => {
|
632
|
+
if (copy[returns[VALUE]])
|
633
|
+
setReturnToType(ref[STATS], copy[returns[VALUE]][STATS])
|
634
|
+
})
|
640
635
|
} else {
|
641
636
|
const ret = returns[0]
|
642
637
|
switch (ret[VALUE]) {
|
@@ -1161,10 +1156,7 @@ export const typeCheck = (ast, error = true) => {
|
|
1161
1156
|
} else {
|
1162
1157
|
// ANONYMOUS LAMBDAS TYPE CHECKING
|
1163
1158
|
const local = Object.create(env)
|
1164
|
-
const lambdaName = `lambda::annonymous::${i}
|
1165
|
-
.now()
|
1166
|
-
.toString()
|
1167
|
-
.replace('.', 0)}*`
|
1159
|
+
const lambdaName = `lambda::annonymous::${i}`
|
1168
1160
|
check(
|
1169
1161
|
[
|
1170
1162
|
[APPLY, KEYWORDS.DEFINE_VARIABLE],
|