Browse Source

Removed unused TS code: IType.ToTypeReference()

pull/1143/head
Daniel Grunwald 7 years ago
parent
commit
61cbdd6f01
  1. 26
      ICSharpCode.Decompiler/TypeSystem/AnonymousType.cs
  2. 5
      ICSharpCode.Decompiler/TypeSystem/ArrayType.cs
  3. 5
      ICSharpCode.Decompiler/TypeSystem/ByReferenceType.cs
  4. 9
      ICSharpCode.Decompiler/TypeSystem/IType.cs
  5. 2
      ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractType.cs
  6. 18
      ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultResolvedTypeDefinition.cs
  7. 5
      ICSharpCode.Decompiler/TypeSystem/Implementation/DummyTypeParameter.cs
  8. 5
      ICSharpCode.Decompiler/TypeSystem/Implementation/UnknownType.cs
  9. 5
      ICSharpCode.Decompiler/TypeSystem/IntersectionType.cs
  10. 5
      ICSharpCode.Decompiler/TypeSystem/ParameterizedType.cs
  11. 5
      ICSharpCode.Decompiler/TypeSystem/PointerType.cs
  12. 5
      ICSharpCode.Decompiler/TypeSystem/SpecialType.cs

26
ICSharpCode.Decompiler/TypeSystem/AnonymousType.cs

@ -106,11 +106,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -106,11 +106,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
}
}
public override ITypeReference ToTypeReference()
{
return new AnonymousTypeReference(unresolvedProperties);
}
public override string Name {
get { return "Anonymous Type"; }
}
@ -197,25 +192,4 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -197,25 +192,4 @@ namespace ICSharpCode.Decompiler.TypeSystem
return true;
}
}
/// <summary>
/// Anonymous type reference.
/// </summary>
[Serializable]
public class AnonymousTypeReference : ITypeReference
{
readonly IUnresolvedProperty[] unresolvedProperties;
public AnonymousTypeReference(IUnresolvedProperty[] properties)
{
if (properties == null)
throw new ArgumentNullException("properties");
this.unresolvedProperties = properties;
}
public IType Resolve(ITypeResolveContext context)
{
return new AnonymousType(context.Compilation, unresolvedProperties);
}
}
}

5
ICSharpCode.Decompiler/TypeSystem/ArrayType.cs

@ -78,11 +78,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -78,11 +78,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
return a != null && elementType.Equals(a.elementType) && a.dimensions == dimensions;
}
public override ITypeReference ToTypeReference()
{
return new ArrayTypeReference(elementType.ToTypeReference(), dimensions);
}
public override IEnumerable<IType> DirectBaseTypes {
get {
List<IType> baseTypes = new List<IType>();

5
ICSharpCode.Decompiler/TypeSystem/ByReferenceType.cs

@ -65,11 +65,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -65,11 +65,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
else
return new ByReferenceType(e);
}
public override ITypeReference ToTypeReference()
{
return new ByReferenceTypeReference(elementType.ToTypeReference());
}
}
[Serializable]

9
ICSharpCode.Decompiler/TypeSystem/IType.cs

@ -115,15 +115,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -115,15 +115,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
/// <returns>Returns the direct base types including interfaces</returns>
IEnumerable<IType> DirectBaseTypes { get; }
/// <summary>
/// Creates a type reference that can be used to look up a type equivalent to this type in another compilation.
/// </summary>
/// <remarks>
/// If this type contains open generics, the resulting type reference will need to be looked up in an appropriate generic context.
/// Otherwise, the main resolve context of a compilation is sufficient.
/// </remarks>
ITypeReference ToTypeReference();
/// <summary>
/// Gets a type visitor that performs the substitution of class type parameters with the type arguments
/// of this parameterized type.

2
ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractType.cs

@ -80,8 +80,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -80,8 +80,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
get { return EmptyList<IType>.Instance; }
}
public abstract ITypeReference ToTypeReference();
public virtual IEnumerable<IType> GetNestedTypes(Predicate<ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)
{
return EmptyList<IType>.Instance;

18
ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultResolvedTypeDefinition.cs

@ -615,24 +615,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -615,24 +615,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
return this;
}
public ITypeReference ToTypeReference()
{
ITypeDefinition declTypeDef = this.DeclaringTypeDefinition;
if (declTypeDef != null) {
return new NestedTypeReference(declTypeDef.ToTypeReference(),
this.Name, this.TypeParameterCount - declTypeDef.TypeParameterCount,
this.IsReferenceType);
} else {
IAssembly asm = this.ParentAssembly;
IAssemblyReference asmRef;
if (asm != null)
asmRef = new DefaultAssemblyReference(asm.AssemblyName);
else
asmRef = null;
return new GetClassTypeReference(asmRef, this.Namespace, this.Name, this.TypeParameterCount, this.IsReferenceType);
}
}
public IEnumerable<IType> GetNestedTypes(Predicate<ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)
{
const GetMemberOptions opt = GetMemberOptions.IgnoreInheritedMembers | GetMemberOptions.ReturnMemberDefinitions;

5
ICSharpCode.Decompiler/TypeSystem/Implementation/DummyTypeParameter.cs

@ -188,11 +188,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -188,11 +188,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
get { return TypeKind.TypeParameter; }
}
public override ITypeReference ToTypeReference()
{
return TypeParameterReference.Create(ownerType, index);
}
public override IType AcceptVisitor(TypeVisitor visitor)
{
return visitor.VisitTypeParameter(this);

5
ICSharpCode.Decompiler/TypeSystem/Implementation/UnknownType.cs

@ -68,11 +68,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -68,11 +68,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
get { return TypeKind.Unknown; }
}
public override ITypeReference ToTypeReference()
{
return this;
}
IType ITypeReference.Resolve(ITypeResolveContext context)
{
if (context == null)

5
ICSharpCode.Decompiler/TypeSystem/IntersectionType.cs

@ -126,11 +126,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -126,11 +126,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
get { return types; }
}
public override ITypeReference ToTypeReference()
{
throw new NotSupportedException();
}
public override IEnumerable<IMethod> GetMethods(Predicate<IUnresolvedMethod> filter, GetMemberOptions options)
{
return GetMembersHelper.GetMethods(this, FilterNonStatic(filter), options);

5
ICSharpCode.Decompiler/TypeSystem/ParameterizedType.cs

@ -158,11 +158,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -158,11 +158,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
return genericType as ITypeDefinition;
}
public ITypeReference ToTypeReference()
{
return new ParameterizedTypeReference(genericType.ToTypeReference(), typeArguments.Select(t => t.ToTypeReference()));
}
/// <summary>
/// Gets a type visitor that performs the substitution of class type parameters with the type arguments
/// of this parameterized type.

5
ICSharpCode.Decompiler/TypeSystem/PointerType.cs

@ -65,11 +65,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -65,11 +65,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
else
return new PointerType(e);
}
public override ITypeReference ToTypeReference()
{
return new PointerTypeReference(elementType.ToTypeReference());
}
}
[Serializable]

5
ICSharpCode.Decompiler/TypeSystem/SpecialType.cs

@ -64,11 +64,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -64,11 +64,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
this.isReferenceType = isReferenceType;
}
public override ITypeReference ToTypeReference()
{
return this;
}
public override string Name {
get { return name; }
}

Loading…
Cancel
Save