Skip to content

Commit 1cb83a4

Browse files
compiler: add Type::message_name
As we move toward generics, the error messages need to be able to refer to types in a readable manner. Add that capability, and use it today in AST dumps. Change-Id: I4284a7ce748276816dc8abec34c672747fd59875 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/536716 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
1 parent 8c056e3 commit 1cb83a4

File tree

3 files changed

+374
-24
lines changed

3 files changed

+374
-24
lines changed

go/ast-dump.cc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,7 @@ Ast_dump_context::dump_type(const Type* t)
223223
if (t == NULL)
224224
this->ostream() << "(nil type)";
225225
else
226-
// FIXME: write a type pretty printer instead of
227-
// using mangled names.
228-
if (this->gogo_ != NULL)
229-
{
230-
Backend_name bname;
231-
t->backend_name(this->gogo_, &bname);
232-
this->ostream() << "(" << bname.name() << ")";
233-
}
226+
this->ostream() << "(" << t->message_name() << ")";
234227
}
235228

236229
// Dump a textual representation of a block to the

0 commit comments

Comments
 (0)