Type constructors work in typeclass instances

This commit is contained in:
Dustin Swan 2026-03-26 21:47:51 -06:00
parent 82816e7fad
commit 0514889ba6
No known key found for this signature in database
GPG key ID: 30D46587E2100467
2 changed files with 10 additions and 0 deletions

View file

@ -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);
}
}
}
}