Fix hetero-tuple issue with fn_overloads

pull/335/head
Ibrahim Numanagić 2023-03-30 18:17:22 -07:00
parent d1b5279ffa
commit da709f5424
1 changed files with 9 additions and 0 deletions

View File

@ -289,6 +289,15 @@ TypecheckVisitor::transformStaticLoopCall(
!ctx->cache->functions[method.name].type)
continue;
if (method.age <= ctx->age) {
if (typ->getHeterogenousTuple()) {
auto &ast = ctx->cache->functions[method.name].ast;
if (ast->hasAttr("autogenerated") &&
(endswith(ast->name, ".__iter__:0") ||
endswith(ast->name, ".__getitem__:0"))) {
// ignore __getitem__ and other heterogenuous methods
continue;
}
}
stmt->rhs = N<IdExpr>(method.name);
block.push_back(wrap(stmt->clone()));
}