[gcjx] Patch: FYI: wildcard pretty-printing

Tom Tromey tromey@redhat.com
Mon Oct 31 23:28:00 GMT 2005


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 ();
 



More information about the Java-patches mailing list