+2004-07-17 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (MemberName.MakeName): Create the "class`1" names here;
+ use an exclamation mark (!) instead of backticks (`) again.
+
2004-07-16 Martin Baulig <martin@ximian.com>
* iterators.cs: Added generics support.
return full_name;
}
- public string GetTypeName (bool full)
+ public static string MakeName (string name, int count)
+ {
+ return name + "!" + count;
+ }
+
+ public string GetTypeName ()
{
string suffix = "";
- if (full && (TypeArguments != null))
- suffix = "`" + TypeArguments.Count;
if (Left != null)
- return Left.GetTypeName (full) + "." + Name + suffix;
+ return Left.GetTypeName () + "." +
+ MakeName (Name, TypeArguments.Count);
else
- return Name + suffix;
+ return MakeName (Name, TypeArguments.Count);
}
public Expression GetTypeExpression (Location loc)
public string Basename {
get {
if (TypeArguments != null)
- return Name + "`" + TypeArguments.Count;
+ return MakeName (Name, TypeArguments.Count);
else
return Name;
}
member_lookup = MemberLookup (
ec, expr_type, expr_type, Identifier, loc);
if ((member_lookup == null) && (args != null)) {
- string lookup_id = Identifier + "`" + args.Count;
+ string lookup_id = MemberName.MakeName (Identifier, args.Count);
member_lookup = MemberLookup (
ec, expr_type, expr_type, lookup_id, loc);
}
fname = full_expr.Identifier;
if (args != null)
- fname = fname + "`" + args.Count;
+ fname = MemberName.MakeName (fname, args.Count);
if (full_expr.Expr is SimpleName) {
string full_name = String.Concat (((SimpleName) full_expr.Expr).Name, ".", fname);
Expression member_lookup;
string lookup_id;
if (args != null)
- lookup_id = Identifier + "`" + args.Count;
+ lookup_id = MemberName.MakeName (Identifier, args.Count);
else
lookup_id = Identifier;
member_lookup = MemberLookupFinal (
public override string ToString ()
{
if (args != null)
- return expr + "." + Identifier + "`" + args.Count;
+ return expr + "." + MemberName.MakeName (Identifier, args.Count);
else
return expr + "." + Identifier;
}
public ConstructedType (string name, TypeArguments args, Location l)
{
loc = l;
- this.name = name + "`" + args.Count;
+ this.name = MemberName.MakeName (name, args.Count);
this.args = args;
eclass = ExprClass.Type;
// this will fail with `using A = Stack<int>'
//
- string alias = Alias.GetTypeName (true);
+ string alias = Alias.GetTypeName ();
while ((curr_ns != null) && (resolved == null)) {
resolved = curr_ns.Lookup (
null, alias, Alias.CountTypeArguments,
//
// Generic types
//
- generic_ienumerator_type = CoreLookupType ("System.Collections.Generic.IEnumerator`1");
- generic_ienumerable_type = CoreLookupType ("System.Collections.Generic.IEnumerable`1");
+ generic_ienumerator_type = CoreLookupType (MemberName.MakeName ("System.Collections.Generic.IEnumerator", 1));
+ generic_ienumerable_type = CoreLookupType (MemberName.MakeName ("System.Collections.Generic.IEnumerable", 1));
//