mirror of https://github.com/exaloop/codon.git
Fix tests
parent
5ee92bd6c9
commit
6ee84e09b9
|
@ -506,7 +506,7 @@ void SimplifyVisitor::visit(FunctionStmt *stmt) {
|
|||
ctx->bases.emplace_back(SimplifyContext::Base{canonicalName}); // Add new base...
|
||||
if (isClassMember && ctx->bases[0].deducedMembers)
|
||||
ctx->bases.back().deducedMembers = ctx->bases[0].deducedMembers;
|
||||
ctx->addBlock(); // ... and a block!
|
||||
ctx->addBlock(); // ... and a block!
|
||||
// Set atomic flag if @atomic attribute is present.
|
||||
if (attr.has(Attr::Atomic))
|
||||
ctx->bases.back().attributes |= FLAG_ATOMIC;
|
||||
|
@ -542,7 +542,6 @@ void SimplifyVisitor::visit(FunctionStmt *stmt) {
|
|||
error("non-default argument '{}' after a default argument", varName);
|
||||
defaultsStarted |= bool(a.deflt);
|
||||
|
||||
|
||||
auto name = ctx->generateCanonicalName(varName);
|
||||
|
||||
auto typeAst = a.type;
|
||||
|
@ -1095,7 +1094,8 @@ StmtPtr SimplifyVisitor::transformAssignment(const ExprPtr &lhs, const ExprPtr &
|
|||
} else if (auto ed = lhs->getDot()) {
|
||||
seqassert(!type, "unexpected type annotation");
|
||||
auto l = transform(ed->expr);
|
||||
if (ctx->bases.back().deducedMembers && l->isId(ctx->bases.back().selfName)) {
|
||||
if (ctx->bases.size() && ctx->bases.back().deducedMembers &&
|
||||
l->isId(ctx->bases.back().selfName)) {
|
||||
if (std::find(ctx->bases.back().deducedMembers->begin(),
|
||||
ctx->bases.back().deducedMembers->end(),
|
||||
ed->member) == ctx->bases.back().deducedMembers->end())
|
||||
|
|
|
@ -158,11 +158,6 @@ types::TypePtr TypecheckVisitor::realizeFunc(types::FuncType *type) {
|
|||
// Find parents!
|
||||
ctx->bases.push_back({type->ast->name, type->getFunc(), type->args[0],
|
||||
{}, findSuperMethods(type->getFunc())});
|
||||
// if (startswith(type->ast->name, "Foo")) {
|
||||
// LOG(": {}", type->toString());
|
||||
// for (auto &s: ctx->bases.back().supers)
|
||||
// LOG(" - {}", s->toString());
|
||||
// }
|
||||
auto clonedAst = ctx->cache->functions[type->ast->name].ast->clone();
|
||||
auto *ast = (FunctionStmt *)clonedAst.get();
|
||||
addFunctionGenerics(type);
|
||||
|
|
Loading…
Reference in New Issue