diff --git a/executable_semantics/interpreter/action.cpp b/executable_semantics/interpreter/action.cpp index 1494aa03c23d..0db7af5dfc43 100644 --- a/executable_semantics/interpreter/action.cpp +++ b/executable_semantics/interpreter/action.cpp @@ -102,7 +102,7 @@ void Action::Print(std::ostream& out) { void Action::PrintList(Stack ls, std::ostream& out) { if (!ls.IsEmpty()) { - PrintList(ls.Pop(), out); + ls.Pop()->Print(out); if (!ls.IsEmpty()) { out << " :: "; PrintList(ls, out); diff --git a/executable_semantics/interpreter/stack.h b/executable_semantics/interpreter/stack.h index ab233b5b9306..9fffa129f266 100644 --- a/executable_semantics/interpreter/stack.h +++ b/executable_semantics/interpreter/stack.h @@ -57,7 +57,7 @@ struct Stack { Stack() { head = nullptr; } // Creates an instance containing just `x`. - Stack(T x) : Stack() { Push(x); } + explicit Stack(T x) : Stack() { Push(x); } // Pushes `x` onto the top of the stack. void Push(T x) { head = new ListNode(x, head); }