Rename some variables in Checker.cc
This commit is contained in:
parent
6f7418c784
commit
9578e5d252
1 changed files with 7 additions and 7 deletions
|
@ -324,11 +324,11 @@ std::tuple<ConstraintSet, Type*> Checker::inferTypeExpr(TypeEnv& Env, TypeExpres
|
||||||
|
|
||||||
case NodeKind::ReferenceTypeExpression:
|
case NodeKind::ReferenceTypeExpression:
|
||||||
{
|
{
|
||||||
auto E = static_cast<ReferenceTypeExpression*>(TE);
|
auto Ref = static_cast<ReferenceTypeExpression*>(TE);
|
||||||
auto Name = E->Name->getCanonicalText();
|
auto Name = Ref->Name->getCanonicalText();
|
||||||
auto Match = Env.lookup(Name, SymbolKind::Type);
|
auto Match = Env.lookup(Name, SymbolKind::Type);
|
||||||
if (Match == nullptr) {
|
if (Match == nullptr) {
|
||||||
DE.add<BindingNotFoundDiagnostic>(Name, E->Name);
|
DE.add<BindingNotFoundDiagnostic>(Name, Ref->Name);
|
||||||
Ty = createTVar();
|
Ty = createTVar();
|
||||||
} else {
|
} else {
|
||||||
Ty = instantiate(Match);
|
Ty = instantiate(Match);
|
||||||
|
@ -532,11 +532,11 @@ ConstraintSet Checker::inferMany(TypeEnv& Env, std::vector<Node*>& Elements, Typ
|
||||||
solve(Out);
|
solve(Out);
|
||||||
for (auto N: Nodes) {
|
for (auto N: Nodes) {
|
||||||
if (isa<FunctionDeclaration>(N)) {
|
if (isa<FunctionDeclaration>(N)) {
|
||||||
auto M = static_cast<FunctionDeclaration*>(N);
|
auto Func = static_cast<FunctionDeclaration*>(N);
|
||||||
auto Unbound = getUnbound(Env, cast<Declaration>(N)->getType());
|
auto Unbound = getUnbound(Env, Func->getType());
|
||||||
Env.add(
|
Env.add(
|
||||||
M->getNameAsString(),
|
Func->getNameAsString(),
|
||||||
new TypeScheme { { Unbound.begin(), Unbound.end() }, M->getType() },
|
new TypeScheme { { Unbound.begin(), Unbound.end() }, Func->getType()->find() },
|
||||||
SymbolKind::Var
|
SymbolKind::Var
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue