diff --git a/src/ast/array.cc b/src/ast/array.cc index c582805311..826efd2950 100644 --- a/src/ast/array.cc +++ b/src/ast/array.cc @@ -26,12 +26,9 @@ namespace ast { namespace { // Returns the string representation of an array size expression. std::string SizeExprToString(const ast::Expression* size, - const SymbolTable* symbols = nullptr) { + const SymbolTable& symbols) { if (auto* ident = size->As()) { - if (symbols) { - return symbols->NameFor(ident->symbol); - } - return ""; + return symbols.NameFor(ident->symbol); } if (auto* scalar = size->As()) { auto* literal = scalar->literal->As(); @@ -65,7 +62,7 @@ std::string Array::FriendlyName(const SymbolTable& symbols) const { } out << "array<" << type->FriendlyName(symbols); if (!IsRuntimeArray()) { - out << ", " << SizeExprToString(count, &symbols); + out << ", " << SizeExprToString(count, symbols); } out << ">"; return out.str();