|
@ -62,9 +62,9 @@ function flattenTypeApp(stx) { |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isTypeExprRec(stx) { |
|
|
function isTypeExprRec(stx) { |
|
|
var flattened = flattenTypeApp(stx); |
|
|
var flattened = flattenTypeApp(stx); |
|
|
console.log(flattened); |
|
|
|
|
|
for(var i = 0; i < flattened.length; i++) { |
|
|
for(var i = 0; i < flattened.length; i++) { |
|
|
if (flattened[i].failed !== undefined && |
|
|
if (flattened[i].failed !== undefined && |
|
|
flattened[i].failed) { |
|
|
flattened[i].failed) { |
|
@ -74,8 +74,6 @@ function isTypeExprRec(stx) { |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function App(func, p) { |
|
|
function App(func, p) { |
|
|
this.func = func; |
|
|
this.func = func; |
|
|
this.exprType = "Application"; |
|
|
this.exprType = "Application"; |
|
@ -270,7 +268,8 @@ function isTypeExpr(expr) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function TypeApp(expression, type) { |
|
|
function TypeApp(expression, type) { |
|
|
if (isTypeExprRec(expression)) { |
|
|
if (isTypeExprRec(expression) && |
|
|
|
|
|
expression.exprType !== "Name") { |
|
|
throw errors.JInternalError( |
|
|
throw errors.JInternalError( |
|
|
"Left-hand-side of type application must not be in the type language" |
|
|
"Left-hand-side of type application must not be in the type language" |
|
|
); |
|
|
); |
|
|