some fixes for zero argument functions, test_code.lang improvements

This commit is contained in:
ProgramSnail 2023-05-13 14:44:17 +03:00
parent 79bd30c1ee
commit 3188ba6a54
4 changed files with 104 additions and 3 deletions

View file

@ -597,7 +597,7 @@ void PrintVisitor::Visit(FunctionType* node) {
out_ << "[FunctionType] (";
bool is_first = true;
for (auto& type : node->types) {
if (!is_first) {
if (!is_first || node->types.size() == 1) {
out_ << " -> ";
}
is_first = false;

View file

@ -849,7 +849,7 @@ void TypedPrintVisitor::Visit(FunctionType* node) {
out_ << "] (";
bool is_first = true;
for (auto& type : node->types) {
if (!is_first) {
if (!is_first || node->types.size() == 1) {
out_ << " -> ";
}
is_first = false;