Add support for inferring kinds from ArrowTypeExpression
This commit is contained in:
parent
6110509c41
commit
83226621e3
1 changed files with 8 additions and 0 deletions
|
@ -867,6 +867,14 @@ export class Checker {
|
||||||
|
|
||||||
private inferKindFromTypeExpression(node: TypeExpression, env: KindEnv): Kind {
|
private inferKindFromTypeExpression(node: TypeExpression, env: KindEnv): Kind {
|
||||||
switch (node.kind) {
|
switch (node.kind) {
|
||||||
|
case SyntaxKind.ArrowTypeExpression:
|
||||||
|
{
|
||||||
|
for (const param of node.paramTypeExprs) {
|
||||||
|
this.unifyKind(this.inferKindFromTypeExpression(param, env), new KStar(), node);
|
||||||
|
}
|
||||||
|
this.unifyKind(this.inferKindFromTypeExpression(node.returnTypeExpr, env), new KStar(), node);
|
||||||
|
return new KStar();
|
||||||
|
}
|
||||||
case SyntaxKind.VarTypeExpression:
|
case SyntaxKind.VarTypeExpression:
|
||||||
case SyntaxKind.ReferenceTypeExpression:
|
case SyntaxKind.ReferenceTypeExpression:
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue