Fix crash when a reference to an unbound var is checked
This commit is contained in:
parent
c98f47b564
commit
9af655c072
1 changed files with 3 additions and 3 deletions
|
@ -340,10 +340,10 @@ ConstraintSet Checker::inferMany(TypeEnv& Env, std::vector<Node*>& Elements, Typ
|
||||||
Node* From;
|
Node* From;
|
||||||
void visitReferenceExpression(ReferenceExpression* E) {
|
void visitReferenceExpression(ReferenceExpression* E) {
|
||||||
auto To = E->getScope()->lookup(E->getSymbolPath());
|
auto To = E->getScope()->lookup(E->getSymbolPath());
|
||||||
|
if (To != nullptr) {
|
||||||
if (isa<Parameter>(To)) {
|
if (isa<Parameter>(To)) {
|
||||||
To = To->Parent;
|
To = To->Parent;
|
||||||
}
|
}
|
||||||
if (To != nullptr) {
|
|
||||||
G.add_edge(From, To);
|
G.add_edge(From, To);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue