Fix lambdas [wip]

typecheck-v2
Ibrahim Numanagić 2024-01-16 09:14:37 -08:00
parent 377e619f7f
commit 41dcb83be0
2 changed files with 5 additions and 2 deletions

View File

@ -434,11 +434,14 @@ void TranslateVisitor::visit(AssignStmt *stmt) {
seqassert(stmt->lhs->getId(), "expected IdExpr, got {}", stmt->lhs);
auto var = stmt->lhs->getId()->value;
if (!stmt->rhs || (!stmt->rhs->isType() && stmt->rhs->type)) {
if (stmt->rhs && stmt->rhs->type->getFunc())
if (stmt->rhs && stmt->rhs->type->getFunc()) {
result = transform(stmt->rhs);
return;
}
if (stmt->rhs && stmt->rhs->type->getPartial() &&
!ctx->find(stmt->rhs->type->getClass()->realizedTypeName())) {
// Partial generic; ignore [TODO]
result = transform(stmt->rhs);
return;
}

View File

@ -24,7 +24,7 @@ void ScopingVisitor::apply(Cache *cache, StmtPtr &s) {
ScopingVisitor v;
v.ctx = c;
v.transformBlock(s);
// LOG("-> {}", s->toString(2));
LOG("-> {}", s->toString(2));
}
ExprPtr ScopingVisitor::transform(const std::shared_ptr<Expr> &expr) {