X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fmcs%2Ftypespec.cs;h=81894f06c762ea1d6146e2e9d99905b2d3a7f4e1;hb=23fbdb66437357ec6d50f498ed8e88590cd89196;hp=edaa4dde69233c9613f88d26b2ff13088b824e95;hpb=c39718bbb394fe97281e6e64945b4572bef29121;p=mono.git diff --git a/mcs/mcs/typespec.cs b/mcs/mcs/typespec.cs index edaa4dde692..81894f06c76 100644 --- a/mcs/mcs/typespec.cs +++ b/mcs/mcs/typespec.cs @@ -295,6 +295,12 @@ namespace Mono.CSharp } } + public bool IsStructOrEnum { + get { + return (Kind & (MemberKind.Struct | MemberKind.Enum)) != 0; + } + } + public bool IsTypeBuilder { get { #if STATIC @@ -484,17 +490,22 @@ namespace Mono.CSharp // // Text representation of type used by documentation writer // - public override string GetSignatureForDocumentation () + public sealed override string GetSignatureForDocumentation () + { + return GetSignatureForDocumentation (false); + } + + public virtual string GetSignatureForDocumentation (bool explicitName) { StringBuilder sb = new StringBuilder (); if (IsNested) { - sb.Append (DeclaringType.GetSignatureForDocumentation ()); - } else { - sb.Append (MemberDefinition.Namespace); + sb.Append (DeclaringType.GetSignatureForDocumentation (explicitName)); + } else if (MemberDefinition.Namespace != null) { + sb.Append (explicitName ? MemberDefinition.Namespace.Replace ('.', '#') : MemberDefinition.Namespace); } if (sb.Length != 0) - sb.Append ("."); + sb.Append (explicitName ? "#" : "."); sb.Append (Name); if (Arity > 0) { @@ -504,7 +515,7 @@ namespace Mono.CSharp if (i > 0) sb.Append (","); - sb.Append (TypeArguments[i].GetSignatureForDocumentation ()); + sb.Append (TypeArguments[i].GetSignatureForDocumentation (explicitName)); } sb.Append ("}"); } else { @@ -516,33 +527,6 @@ namespace Mono.CSharp return sb.ToString (); } - public string GetExplicitNameSignatureForDocumentation () - { - StringBuilder sb = new StringBuilder (); - if (IsNested) { - sb.Append (DeclaringType.GetExplicitNameSignatureForDocumentation ()); - } else if (MemberDefinition.Namespace != null) { - sb.Append (MemberDefinition.Namespace.Replace ('.', '#')); - } - - if (sb.Length != 0) - sb.Append ("#"); - - sb.Append (Name); - if (Arity > 0) { - sb.Append ("{"); - for (int i = 0; i < Arity; ++i) { - if (i > 0) - sb.Append (","); - - sb.Append (TypeArguments[i].GetExplicitNameSignatureForDocumentation ()); - } - sb.Append ("}"); - } - - return sb.ToString (); - } - public override string GetSignatureForError () { string s; @@ -645,6 +629,7 @@ namespace Mono.CSharp case MemberKind.Struct: case MemberKind.Enum: case MemberKind.Void: + case MemberKind.PointerType: return false; case MemberKind.InternalCompilerType: // @@ -1253,6 +1238,9 @@ namespace Mono.CSharp return false; } + if (a.IsNested && b.IsNested) + return IsEqual (a.DeclaringType, b.DeclaringType); + return true; } @@ -1436,6 +1424,7 @@ namespace Mono.CSharp public static readonly InternalType FakeInternalType = new InternalType (""); public static readonly InternalType Namespace = new InternalType (""); public static readonly InternalType ErrorType = new InternalType (""); + public static readonly InternalType VarOutType = new InternalType ("var out"); readonly string name; @@ -1638,6 +1627,11 @@ namespace Mono.CSharp #endregion + public override void CheckObsoleteness (IMemberContext mc, Location loc) + { + Element.CheckObsoleteness (mc, loc); + } + public override ObsoleteAttribute GetAttributeObsolete () { return Element.GetAttributeObsolete (); @@ -1648,9 +1642,9 @@ namespace Mono.CSharp return null; } - public override string GetSignatureForDocumentation () + public override string GetSignatureForDocumentation (bool explicitName) { - return Element.GetSignatureForDocumentation () + GetPostfixSignature (); + return Element.GetSignatureForDocumentation (explicitName) + GetPostfixSignature (); } public override string GetSignatureForError () @@ -1883,29 +1877,33 @@ namespace Mono.CSharp return sb.ToString (); } - public override string GetSignatureForDocumentation () + public override string GetSignatureForDocumentation (bool explicitName) { StringBuilder sb = new StringBuilder (); - GetElementSignatureForDocumentation (sb); + GetElementSignatureForDocumentation (sb, explicitName); return sb.ToString (); } - void GetElementSignatureForDocumentation (StringBuilder sb) + void GetElementSignatureForDocumentation (StringBuilder sb, bool explicitName) { var ac = Element as ArrayContainer; if (ac == null) - sb.Append (Element.GetSignatureForDocumentation ()); + sb.Append (Element.GetSignatureForDocumentation (explicitName)); else - ac.GetElementSignatureForDocumentation (sb); + ac.GetElementSignatureForDocumentation (sb, explicitName); - sb.Append ("["); - for (int i = 1; i < rank; i++) { - if (i == 1) - sb.Append ("0:"); + if (explicitName) { + sb.Append (GetPostfixSignature (rank)); + } else { + sb.Append ("["); + for (int i = 1; i < rank; i++) { + if (i == 1) + sb.Append ("0:"); - sb.Append (",0:"); + sb.Append (",0:"); + } + sb.Append ("]"); } - sb.Append ("]"); } public static ArrayContainer MakeType (ModuleContainer module, TypeSpec element) @@ -1927,6 +1925,11 @@ namespace Mono.CSharp return ac; } + + public override List ResolveMissingDependencies (MemberSpec caller) + { + return Element.ResolveMissingDependencies (caller); + } } class ReferenceContainer : ElementTypeSpec