Type constructors work in typeclass instances
This commit is contained in:
parent
82816e7fad
commit
0514889ba6
2 changed files with 10 additions and 0 deletions
|
|
@ -168,6 +168,11 @@ function infer(expr: AST, env: TypeEnv, subst: Subst): TypeAST | null {
|
|||
if (!instances || !instances.has(resolved.name)) {
|
||||
warn(`No instance ${constraint.className} ${resolved.name}`, expr);
|
||||
}
|
||||
} else if (resolved.kind === 'type-apply' && resolved.constructor.kind === 'type-name') {
|
||||
const instances = moduleInstances.get(constraint.className);
|
||||
if (!instances || !instances.has(resolved.constructor.name)) {
|
||||
warn(`No instance ${constraint.className} ${resolved.constructor.name}`, expr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue