This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: wildcard pretty-printing
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 31 Oct 2005 16:22:10 -0700
- Subject: [gcjx] Patch: FYI: wildcard pretty-printing
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
This fixes pretty-printing for wildcard types. This is useful for
debugging and error messages.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* model/wildcard.cc (get_pretty_name): New method.
* model/wildcard.hh (model_wildcard::get_pretty_name): No longer
inline.
Index: model/wildcard.cc
===================================================================
--- model/wildcard.cc (revision 105957)
+++ model/wildcard.cc (working copy)
@@ -110,6 +110,16 @@
return result;
}
+std::string
+model_wildcard::get_pretty_name () const
+{
+ std::string result = "?";
+ if (bound)
+ result += ((is_super ? " super " : " extends ")
+ + bound->type ()->get_pretty_name ());
+ return result;
+}
+
void
model_wildcard::visit (visitor *v)
{
Index: model/wildcard.hh
===================================================================
--- model/wildcard.hh (revision 105957)
+++ model/wildcard.hh (working copy)
@@ -89,10 +89,7 @@
bool contains_p (model_class *);
- std::string get_pretty_name () const
- {
- return name;
- }
+ std::string get_pretty_name () const;
std::string get_signature ();