Fix references to unbound types not being reported

This commit is contained in:
Sam Vervaeck 2023-05-27 23:15:45 +02:00
parent 3efd2a6d6a
commit ad460bc4a2
Signed by: samvv
SSH key fingerprint: SHA256:dIg0ywU1OP+ZYifrYxy8c5esO72cIKB+4/9wkZj1VaY

View file

@ -570,9 +570,7 @@ namespace bolt {
auto RefTE = static_cast<ReferenceTypeExpression*>(N);
auto Ty = lookupMono(RefTE->Name->getCanonicalText());
if (Ty == nullptr) {
if (Config.typeVarsRequireForall()) {
DE.add<BindingNotFoundDiagnostic>(RefTE->Name->getCanonicalText(), RefTE->Name);
}
DE.add<BindingNotFoundDiagnostic>(RefTE->Name->getCanonicalText(), RefTE->Name);
Ty = createTypeVar();
}
N->setType(Ty);