Commit 6e47d31f authored by Théotime Grohens's avatar Théotime Grohens Committed by Commit Bot

[torque] Fix Signature printing

The operator<< for Signature objects in Torque incorrectly counted
the number of named parameters instead of the total number
of parameters when displaying them.

This would cause the displayed signature to be "()" when no
parameters were named, instead of the actual signature.

Change-Id: I32572da5f5a378b71749515d89429172129bbcb9
Reviewed-on: https://chromium-review.googlesource.com/1104172Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Théotime Grohens <theotime@google.com>
Cr-Commit-Position: refs/heads/master@{#53792}
parent fffa3317
......@@ -150,7 +150,7 @@ std::string UnionType::GetGeneratedTNodeTypeName() const {
std::ostream& operator<<(std::ostream& os, const Signature& sig) {
os << "(";
for (size_t i = 0; i < sig.parameter_names.size(); ++i) {
for (size_t i = 0; i < sig.parameter_types.types.size(); ++i) {
if (i > 0) os << ", ";
if (!sig.parameter_names.empty()) os << sig.parameter_names[i] << ": ";
os << sig.parameter_types.types[i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment