Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ajreynol committed Apr 3, 2024
1 parent 1381c26 commit 66e6445
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/kind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ std::ostream& operator<<(std::ostream& o, Kind k)
case Kind::EVAL_TYPE_OF: o << "EVAL_TYPE_OF"; break;
case Kind::EVAL_NAME_OF: o << "EVAL_NAME_OF"; break;
// lists
case Kind::EVAL_NIL: o << "EVAL_EMPTYLIST";break;
case Kind::EVAL_NIL: o << "EVAL_NIL";break;
case Kind::EVAL_CONS: o << "EVAL_CONS"; break;
// boolean
case Kind::EVAL_NOT: o << "EVAL_NOT"; break;
Expand Down
8 changes: 7 additions & 1 deletion src/type_checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,13 @@ Expr TypeChecker::evaluateLiteralOpInternal(
bool isLeft = (ck==Attr::LEFT_ASSOC_NIL);
Trace("type_checker_debug") << "EVALUATE-LIT (list) " << k << " " << isLeft << " " << args << std::endl;
// infer the nil expression, which depends on the type of args[1]
Expr nilExpr = computeConstructorTermInternal(ac, {Expr(args[0]), Expr(args[1])});
std::vector<Expr> eargs;
eargs.emplace_back(args[0]);
if (args.size()>1)
{
eargs.emplace_back(args[1]);
}
Expr nilExpr = computeConstructorTermInternal(ac, eargs);
if (nilExpr.isNull())
{
Trace("type_checker") << "...failed to get nil" << std::endl;
Expand Down

0 comments on commit 66e6445

Please sign in to comment.