From 1bcc25500490ebe2e83e901370590e073286b16b Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sun, 3 Sep 2017 17:58:22 +0200 Subject: [PATCH] Remove a bunch of obsolete NRefactory code. --- .../ICSharpCode.Decompiler.Tests.csproj | 4 ++ .../CSharp/OutputVisitor/CSharpAmbience.cs | 12 ---- .../CSharp/Resolver/CSharpOperators.cs | 10 --- .../CSharp/Resolver/CSharpResolver.cs | 17 ----- .../CSharp/Resolver/ReducedExtensionMethod.cs | 12 ---- .../Syntax/Expressions/ErrorExpression.cs | 36 ----------- ICSharpCode.Decompiler/CecilExtensions.cs | 1 - .../ICSharpCode.Decompiler.csproj | 6 +- .../Semantics/Conversion.cs | 16 ----- .../TypeSystem/CecilLoader.cs | 13 ---- .../TypeSystem/EntityType.cs | 63 ------------------- .../TypeSystem/IAmbience.cs | 4 -- ICSharpCode.Decompiler/TypeSystem/IEntity.cs | 6 -- ICSharpCode.Decompiler/TypeSystem/IMember.cs | 10 --- ICSharpCode.Decompiler/TypeSystem/IMethod.cs | 6 -- .../TypeSystem/IProjectContent.cs | 12 ---- .../TypeSystem/IUnresolvedFile.cs | 3 - .../Implementation/AbstractResolvedEntity.cs | 5 -- .../Implementation/AbstractResolvedMember.cs | 5 -- .../DefaultAssemblyReference.cs | 3 - .../Implementation/DefaultResolvedMethod.cs | 5 -- .../DefaultResolvedTypeDefinition.cs | 5 -- .../Implementation/DefaultUnresolvedMethod.cs | 26 -------- .../FullNameAndTypeParameterCount.cs | 27 -------- .../Implementation/GetClassTypeReference.cs | 7 --- .../Implementation/SpecializedMember.cs | 20 ------ .../Implementation/SpecializedMethod.cs | 7 +-- .../TypeSystem/ParameterListComparer.cs | 11 ---- .../TypeSystem/VarArgInstanceMethod.cs | 17 +---- 29 files changed, 11 insertions(+), 358 deletions(-) delete mode 100644 ICSharpCode.Decompiler/TypeSystem/EntityType.cs delete mode 100644 ICSharpCode.Decompiler/TypeSystem/Implementation/FullNameAndTypeParameterCount.cs diff --git a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj index b615cc7c0..ba0dc00cc 100644 --- a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj +++ b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj @@ -111,4 +111,8 @@ + + + + \ No newline at end of file diff --git a/ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpAmbience.cs b/ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpAmbience.cs index 7697e6414..fccd473d8 100644 --- a/ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpAmbience.cs +++ b/ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpAmbience.cs @@ -31,12 +31,6 @@ namespace ICSharpCode.Decompiler.CSharp.OutputVisitor public ConversionFlags ConversionFlags { get; set; } #region ConvertSymbol - [Obsolete("Use ConvertSymbol() instead")] - public string ConvertEntity(IEntity entity) - { - return ConvertSymbol(entity); - } - public string ConvertSymbol(ISymbol symbol) { if (symbol == null) @@ -47,12 +41,6 @@ namespace ICSharpCode.Decompiler.CSharp.OutputVisitor return writer.ToString(); } - [Obsolete("Use ConvertSymbol() instead")] - public void ConvertEntity(IEntity entity, TokenWriter writer, CSharpFormattingOptions formattingPolicy) - { - ConvertSymbol(entity, writer, formattingPolicy); - } - public void ConvertSymbol(ISymbol symbol, TokenWriter writer, CSharpFormattingOptions formattingPolicy) { if (symbol == null) diff --git a/ICSharpCode.Decompiler/CSharp/Resolver/CSharpOperators.cs b/ICSharpCode.Decompiler/CSharp/Resolver/CSharpOperators.cs index d923ae9ab..33e9955e5 100644 --- a/ICSharpCode.Decompiler/CSharp/Resolver/CSharpOperators.cs +++ b/ICSharpCode.Decompiler/CSharp/Resolver/CSharpOperators.cs @@ -151,11 +151,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver get { return SymbolKind.Operator; } } - [Obsolete("Use the SymbolKind property instead.")] - EntityType IEntity.EntityType { - get { return EntityType.Operator; } - } - DomRegion IEntity.Region { get { return DomRegion.Empty; } } @@ -224,11 +219,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver get { return compilation.MainAssembly; } } - IMemberReference IMember.ToMemberReference() - { - throw new NotSupportedException(); - } - ISymbolReference ISymbol.ToReference() { throw new NotSupportedException(); diff --git a/ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs b/ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs index 62e3797da..2d12dedd4 100644 --- a/ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs +++ b/ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs @@ -352,17 +352,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver } #endregion - #region Clone - /// - /// Creates a copy of this CSharp resolver. - /// - [Obsolete("CSharpResolver is immutable, cloning is no longer necessary")] - public CSharpResolver Clone() - { - return this; - } - #endregion - #region ResolveUnaryOperator #region ResolveUnaryOperator method public ResolveResult ResolveUnaryOperator(UnaryOperatorType op, ResolveResult expression) @@ -1720,12 +1709,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver return result; } - [Obsolete("Use ResolveMemberAccess() with NameLookupMode.Type instead")] - public ResolveResult ResolveMemberType(ResolveResult target, string identifier, IList typeArguments) - { - return ResolveMemberAccess(target, identifier, typeArguments, NameLookupMode.Type); - } - ResolveResult ResolveMemberAccessOnNamespace(NamespaceResolveResult nrr, string identifier, IList typeArguments, bool parameterizeResultType) { if (typeArguments.Count == 0) { diff --git a/ICSharpCode.Decompiler/CSharp/Resolver/ReducedExtensionMethod.cs b/ICSharpCode.Decompiler/CSharp/Resolver/ReducedExtensionMethod.cs index 58bb9909b..64d36b326 100644 --- a/ICSharpCode.Decompiler/CSharp/Resolver/ReducedExtensionMethod.cs +++ b/ICSharpCode.Decompiler/CSharp/Resolver/ReducedExtensionMethod.cs @@ -93,11 +93,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver } } } - - public IMemberReference ToMemberReference() - { - return new ReducedExtensionMethodMemberReference (baseMethod); - } public IMemberReference ToReference() { @@ -286,13 +281,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver } } - [Obsolete("Use the SymbolKind property instead.")] - public EntityType EntityType { - get { - return baseMethod.EntityType; - } - } - public DomRegion Region { get { return baseMethod.Region; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs index f5e700ca2..b7983b0bc 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs @@ -27,42 +27,6 @@ using System; namespace ICSharpCode.Decompiler.CSharp.Syntax { - [Obsolete("This class is obsolete. Remove all referencing code.")] - public class EmptyExpression : AstNode - { - #region implemented abstract members of AstNode - - public override void AcceptVisitor(IAstVisitor visitor) - { - throw new NotImplementedException(); - } - - public override T AcceptVisitor(IAstVisitor visitor) - { - throw new NotImplementedException(); - } - - public override S AcceptVisitor(IAstVisitor visitor, T data) - { - throw new NotImplementedException(); - } - - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) - { - throw new NotImplementedException(); - } - - public override NodeType NodeType { - get { - throw new NotImplementedException(); - } - } - - #endregion - - - } - public class ErrorExpression : Expression { TextLocation location; diff --git a/ICSharpCode.Decompiler/CecilExtensions.cs b/ICSharpCode.Decompiler/CecilExtensions.cs index a8293f56c..dff625b80 100644 --- a/ICSharpCode.Decompiler/CecilExtensions.cs +++ b/ICSharpCode.Decompiler/CecilExtensions.cs @@ -211,7 +211,6 @@ namespace ICSharpCode.Decompiler return null; } - //[Obsolete("throwing exceptions is considered a bug")] public static TypeDefinition ResolveOrThrow(this TypeReference typeReference) { var resolved = typeReference.Resolve(); diff --git a/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj b/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj index 0f1025da8..3d5f7d33e 100644 --- a/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj +++ b/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj @@ -384,7 +384,6 @@ - @@ -432,7 +431,6 @@ - @@ -538,6 +536,10 @@ + + + + diff --git a/ICSharpCode.Decompiler/Semantics/Conversion.cs b/ICSharpCode.Decompiler/Semantics/Conversion.cs index 7fb62fbb5..c36a17982 100644 --- a/ICSharpCode.Decompiler/Semantics/Conversion.cs +++ b/ICSharpCode.Decompiler/Semantics/Conversion.cs @@ -74,22 +74,6 @@ namespace ICSharpCode.Decompiler.Semantics /// public static readonly Conversion TryCast = new BuiltinConversion(false, 9); - [Obsolete("Use UserDefinedConversion() instead")] - public static Conversion UserDefinedImplicitConversion(IMethod operatorMethod, Conversion conversionBeforeUserDefinedOperator, Conversion conversionAfterUserDefinedOperator, bool isLifted) - { - if (operatorMethod == null) - throw new ArgumentNullException("operatorMethod"); - return new UserDefinedConv(true, operatorMethod, conversionBeforeUserDefinedOperator, conversionAfterUserDefinedOperator, isLifted, false); - } - - [Obsolete("Use UserDefinedConversion() instead")] - public static Conversion UserDefinedExplicitConversion(IMethod operatorMethod, Conversion conversionBeforeUserDefinedOperator, Conversion conversionAfterUserDefinedOperator, bool isLifted) - { - if (operatorMethod == null) - throw new ArgumentNullException("operatorMethod"); - return new UserDefinedConv(false, operatorMethod, conversionBeforeUserDefinedOperator, conversionAfterUserDefinedOperator, isLifted, false); - } - public static Conversion UserDefinedConversion(IMethod operatorMethod, bool isImplicit, Conversion conversionBeforeUserDefinedOperator, Conversion conversionAfterUserDefinedOperator, bool isLifted = false, bool isAmbiguous = false) { if (operatorMethod == null) diff --git a/ICSharpCode.Decompiler/TypeSystem/CecilLoader.cs b/ICSharpCode.Decompiler/TypeSystem/CecilLoader.cs index 513550af8..c52d0df6b 100644 --- a/ICSharpCode.Decompiler/TypeSystem/CecilLoader.cs +++ b/ICSharpCode.Decompiler/TypeSystem/CecilLoader.cs @@ -109,19 +109,6 @@ namespace ICSharpCode.Decompiler.TypeSystem { } - /// - /// Initializes a new instance of the class. - /// - /// - /// If true references to the cecil objects are hold. In this case the cecil loader can do a type system -> cecil mapping. - /// - [Obsolete("The built-in entity<->cecil mapping is obsolete. Use the OnEntityLoaded callback instead!")] - public CecilLoader(bool createCecilReferences) : this() - { - if (createCecilReferences) - typeSystemTranslationTable = new Dictionary (); - } - /// /// Creates a nested CecilLoader for lazy-loading. /// diff --git a/ICSharpCode.Decompiler/TypeSystem/EntityType.cs b/ICSharpCode.Decompiler/TypeSystem/EntityType.cs deleted file mode 100644 index 3cb27a121..000000000 --- a/ICSharpCode.Decompiler/TypeSystem/EntityType.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; - -namespace ICSharpCode.Decompiler.TypeSystem -{ - [Obsolete("Use SymbolKind instead")] - public enum EntityType : byte - { - None = SymbolKind.None, - /// - TypeDefinition = SymbolKind.TypeDefinition, - /// - Field = SymbolKind.Field, - /// - /// The symbol is a property, but not an indexer. - /// - /// - Property = SymbolKind.Property, - /// - /// The symbol is an indexer, not a regular property. - /// - /// - Indexer = SymbolKind.Indexer, - /// - Event = SymbolKind.Event, - /// - /// The symbol is a method which is not an operator/constructor/destructor or accessor. - /// - /// - Method = SymbolKind.Method, - /// - /// The symbol is a user-defined operator. - /// - /// - Operator = SymbolKind.Operator, - /// - Constructor = SymbolKind.Constructor, - /// - Destructor = SymbolKind.Destructor, - /// - /// The accessor method for a property getter/setter or event add/remove. - /// - /// - Accessor = SymbolKind.Accessor, - } -} diff --git a/ICSharpCode.Decompiler/TypeSystem/IAmbience.cs b/ICSharpCode.Decompiler/TypeSystem/IAmbience.cs index 18907d08a..0552568ee 100644 --- a/ICSharpCode.Decompiler/TypeSystem/IAmbience.cs +++ b/ICSharpCode.Decompiler/TypeSystem/IAmbience.cs @@ -94,12 +94,8 @@ namespace ICSharpCode.Decompiler.TypeSystem { ConversionFlags ConversionFlags { get; set; } - [Obsolete("Use ConvertSymbol() instead")] - string ConvertEntity(IEntity entity); string ConvertSymbol(ISymbol symbol); string ConvertType(IType type); - [Obsolete("Use ConvertSymbol() instead")] - string ConvertVariable(IVariable variable); string ConvertConstantValue(object constantValue); string WrapComment(string comment); diff --git a/ICSharpCode.Decompiler/TypeSystem/IEntity.cs b/ICSharpCode.Decompiler/TypeSystem/IEntity.cs index 43f5cef74..b20ced56a 100644 --- a/ICSharpCode.Decompiler/TypeSystem/IEntity.cs +++ b/ICSharpCode.Decompiler/TypeSystem/IEntity.cs @@ -93,12 +93,6 @@ namespace ICSharpCode.Decompiler.TypeSystem /// public interface IEntity : ISymbol, ICompilationProvider, INamedElement, IHasAccessibility { - /// - /// Gets the entity type. - /// - [Obsolete("Use the SymbolKind property instead.")] - EntityType EntityType { get; } - /// /// Gets the short name of the entity. /// diff --git a/ICSharpCode.Decompiler/TypeSystem/IMember.cs b/ICSharpCode.Decompiler/TypeSystem/IMember.cs index d8e2d4b53..07249c259 100644 --- a/ICSharpCode.Decompiler/TypeSystem/IMember.cs +++ b/ICSharpCode.Decompiler/TypeSystem/IMember.cs @@ -166,16 +166,6 @@ namespace ICSharpCode.Decompiler.TypeSystem /// If this member is specialized using open generic types, the resulting member reference will need to be looked up in an appropriate generic context. /// Otherwise, the main resolve context of a compilation is sufficient. /// - [Obsolete("Use the ToReference method instead.")] - IMemberReference ToMemberReference(); - - /// - /// Creates a member reference that can be used to rediscover this member in another compilation. - /// - /// - /// If this member is specialized using open generic types, the resulting member reference will need to be looked up in an appropriate generic context. - /// Otherwise, the main resolve context of a compilation is sufficient. - /// new IMemberReference ToReference(); /// diff --git a/ICSharpCode.Decompiler/TypeSystem/IMethod.cs b/ICSharpCode.Decompiler/TypeSystem/IMethod.cs index 61c077123..d6a18e2b8 100644 --- a/ICSharpCode.Decompiler/TypeSystem/IMethod.cs +++ b/ICSharpCode.Decompiler/TypeSystem/IMethod.cs @@ -44,12 +44,6 @@ namespace ICSharpCode.Decompiler.TypeSystem /// Gets whether the method is a C#-style async method. /// bool IsAsync { get; } - - [Obsolete("Use IsPartial && !HasBody instead")] - bool IsPartialMethodDeclaration { get; } - - [Obsolete("Use IsPartial && HasBody instead")] - bool IsPartialMethodImplementation { get; } /// /// Gets whether the method has a body. diff --git a/ICSharpCode.Decompiler/TypeSystem/IProjectContent.cs b/ICSharpCode.Decompiler/TypeSystem/IProjectContent.cs index bf51a4f2b..0806033e9 100644 --- a/ICSharpCode.Decompiler/TypeSystem/IProjectContent.cs +++ b/ICSharpCode.Decompiler/TypeSystem/IProjectContent.cs @@ -136,18 +136,6 @@ namespace ICSharpCode.Decompiler.TypeSystem /// IProjectContent RemoveFiles(params string[] fileNames); - /// - /// Removes types and attributes from oldFile from the project, and adds those from newFile. - /// - [Obsolete("Use RemoveFiles()/AddOrUpdateFiles() instead")] - IProjectContent UpdateProjectContent(IUnresolvedFile oldFile, IUnresolvedFile newFile); - - /// - /// Removes types and attributes from oldFiles from the project, and adds those from newFiles. - /// - [Obsolete("Use RemoveFiles()/AddOrUpdateFiles() instead")] - IProjectContent UpdateProjectContent(IEnumerable oldFiles, IEnumerable newFiles); - /// /// Sets the compiler settings object. /// The concrete type of the settings object depends on the programming language used to implement this project. diff --git a/ICSharpCode.Decompiler/TypeSystem/IUnresolvedFile.cs b/ICSharpCode.Decompiler/TypeSystem/IUnresolvedFile.cs index 9895e9e25..30a5b8344 100644 --- a/ICSharpCode.Decompiler/TypeSystem/IUnresolvedFile.cs +++ b/ICSharpCode.Decompiler/TypeSystem/IUnresolvedFile.cs @@ -22,9 +22,6 @@ using ICSharpCode.Decompiler.CSharp.Syntax; namespace ICSharpCode.Decompiler.TypeSystem { - [Obsolete("IParsedFile was renamed to IUnresolvedFile", true)] - public interface IParsedFile {} - /// /// Represents a single file that was parsed. /// diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractResolvedEntity.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractResolvedEntity.cs index 2d330a732..e259ed5b5 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractResolvedEntity.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractResolvedEntity.cs @@ -44,11 +44,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation get { return unresolved.SymbolKind; } } - [Obsolete("Use the SymbolKind property instead.")] - public EntityType EntityType { - get { return (EntityType)unresolved.SymbolKind; } - } - public DomRegion Region { get { return unresolved.Region; } } diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractResolvedMember.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractResolvedMember.cs index 87e2eaec3..c95e9b166 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractResolvedMember.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractResolvedMember.cs @@ -129,11 +129,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation } } - public virtual IMemberReference ToMemberReference() - { - return (IMemberReference)ToReference(); - } - internal IMethod GetAccessor(ref IMethod accessorField, IUnresolvedMethod unresolvedAccessor) { if (unresolvedAccessor == null) diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultAssemblyReference.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultAssemblyReference.cs index 917bbec31..b9610e96c 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultAssemblyReference.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultAssemblyReference.cs @@ -28,9 +28,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation { public static readonly IAssemblyReference CurrentAssembly = new CurrentAssemblyReference(); - [Obsolete("The corlib is not always called 'mscorlib' (as returned by this property), but might be 'System.Runtime'.")] - public static readonly IAssemblyReference Corlib = new DefaultAssemblyReference("mscorlib"); - readonly string shortName; public DefaultAssemblyReference(string assemblyName) diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultResolvedMethod.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultResolvedMethod.cs index 2c572e51b..a0eb3006e 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultResolvedMethod.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultResolvedMethod.cs @@ -246,11 +246,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation } } - public override IMemberReference ToMemberReference() - { - return (IMemberReference)ToReference(); - } - public override IMember Specialize(TypeParameterSubstitution substitution) { if (TypeParameterSubstitution.Identity.Equals(substitution)) diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultResolvedTypeDefinition.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultResolvedTypeDefinition.cs index 45a60c316..f900a6192 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultResolvedTypeDefinition.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultResolvedTypeDefinition.cs @@ -114,11 +114,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation get { return parts[0].SymbolKind; } } - [Obsolete("Use the SymbolKind property instead.")] - public EntityType EntityType { - get { return (EntityType)parts[0].SymbolKind; } - } - public virtual TypeKind Kind { get { return parts[0].Kind; } } diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultUnresolvedMethod.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultUnresolvedMethod.cs index 48fd837e9..8b8522aa3 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultUnresolvedMethod.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultUnresolvedMethod.cs @@ -138,32 +138,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation } } - [Obsolete] - public bool IsPartialMethodDeclaration { - get { return IsPartial && !HasBody; } - set { - if (value) { - IsPartial = true; - HasBody = false; - } else if (!value && IsPartial && !HasBody) { - IsPartial = false; - } - } - } - - [Obsolete] - public bool IsPartialMethodImplementation { - get { return IsPartial && HasBody; } - set { - if (value) { - IsPartial = true; - HasBody = true; - } else if (!value && IsPartial && HasBody) { - IsPartial = false; - } - } - } - public IList Parameters { get { if (parameters == null) diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/FullNameAndTypeParameterCount.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/FullNameAndTypeParameterCount.cs deleted file mode 100644 index 408a5c7f7..000000000 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/FullNameAndTypeParameterCount.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; - -namespace ICSharpCode.Decompiler.TypeSystem.Implementation -{ - [Obsolete("This struct was renamed to 'TopLevelTypeName'.", true)] - public struct FullNameAndTypeParameterCount - { - } -} diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/GetClassTypeReference.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/GetClassTypeReference.cs index 59b3351eb..a204ded02 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/GetClassTypeReference.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/GetClassTypeReference.cs @@ -80,13 +80,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation /// public FullTypeName FullTypeName { get { return fullTypeName; } } - [Obsolete("Use the FullTypeName property instead. GetClassTypeReference now supports nested types, where the Namespace/Name/TPC tripel isn't sufficient for identifying the type.")] - public string Namespace { get { return fullTypeName.TopLevelTypeName.Namespace; } } - [Obsolete("Use the FullTypeName property instead. GetClassTypeReference now supports nested types, where the Namespace/Name/TPC tripel isn't sufficient for identifying the type.")] - public string Name { get { return fullTypeName.Name; } } - [Obsolete("Use the FullTypeName property instead. GetClassTypeReference now supports nested types, where the Namespace/Name/TPC tripel isn't sufficient for identifying the type.")] - public int TypeParameterCount { get { return fullTypeName.TypeParameterCount; } } - IType ResolveInAllAssemblies(ITypeResolveContext context) { var compilation = context.Compilation; diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedMember.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedMember.cs index f4da0fb6a..eb7d546bd 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedMember.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedMember.cs @@ -58,21 +58,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation this.substitution = TypeParameterSubstitution.Compose(newSubstitution, this.substitution); } - [Obsolete("Use IMember.Specialize() instead")] - public static IMember Create(IMember memberDefinition, TypeParameterSubstitution substitution) - { - if (memberDefinition == null) { - return null; - } else { - return memberDefinition.Specialize(substitution); - } - } - - public virtual IMemberReference ToMemberReference() - { - return ToReference(); - } - public virtual IMemberReference ToReference() { return new SpecializingMemberReference( @@ -185,11 +170,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation get { return baseMember.SymbolKind; } } - [Obsolete("Use the SymbolKind property instead.")] - public EntityType EntityType { - get { return baseMember.EntityType; } - } - public DomRegion Region { get { return baseMember.Region; } } diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedMethod.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedMethod.cs index bec4e1f0f..aba44f2ef 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedMethod.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedMethod.cs @@ -158,7 +158,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation // the generic method itself is parameterized, not if the generic method is only // specialized with class type arguments. - // This is necessary due to this part of the ToMemberReference() contract: + // This is necessary due to this part of the ToReference() contract: // If this member is specialized using open generic types, the resulting member reference will need to be looked up in an appropriate generic context. // Otherwise, the main resolve context of a compilation is sufficient. // -> @@ -175,11 +175,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation } } - public override IMemberReference ToMemberReference() - { - return ToReference(); - } - public override bool Equals(object obj) { SpecializedMethod other = obj as SpecializedMethod; diff --git a/ICSharpCode.Decompiler/TypeSystem/ParameterListComparer.cs b/ICSharpCode.Decompiler/TypeSystem/ParameterListComparer.cs index 982ef534a..460e52b9f 100644 --- a/ICSharpCode.Decompiler/TypeSystem/ParameterListComparer.cs +++ b/ICSharpCode.Decompiler/TypeSystem/ParameterListComparer.cs @@ -56,17 +56,6 @@ namespace ICSharpCode.Decompiler.TypeSystem static readonly NormalizeTypeVisitor normalizationVisitor = new NormalizeTypeVisitor(); - /// - /// Replaces all occurrences of method type parameters in the given type - /// by normalized type parameters. This allows comparing parameter types from different - /// generic methods. - /// - [Obsolete("Use DummyTypeParameter.NormalizeMethodTypeParameters instead if you only need to normalize type parameters. Also, consider if you need to normalize object vs. dynamic as well.")] - public IType NormalizeMethodTypeParameters(IType type) - { - return DummyTypeParameter.NormalizeMethodTypeParameters(type); - } - public bool Equals(IList x, IList y) { if (x == y) diff --git a/ICSharpCode.Decompiler/TypeSystem/VarArgInstanceMethod.cs b/ICSharpCode.Decompiler/TypeSystem/VarArgInstanceMethod.cs index 66ee9252c..d3463a3ac 100644 --- a/ICSharpCode.Decompiler/TypeSystem/VarArgInstanceMethod.cs +++ b/ICSharpCode.Decompiler/TypeSystem/VarArgInstanceMethod.cs @@ -165,13 +165,7 @@ namespace ICSharpCode.Decompiler.TypeSystem #endregion #region IMember implementation - - [Obsolete("Use the ToReference method instead.")] - public IMemberReference ToMemberReference() - { - return ToReference(); - } - + public IMemberReference ToReference() { throw new NotImplementedException(); @@ -238,14 +232,7 @@ namespace ICSharpCode.Decompiler.TypeSystem #endregion #region IEntity implementation - - [Obsolete] - public EntityType EntityType { - get { - throw new NotImplementedException(); - } - } - + public DomRegion Region { get { return baseMethod.Region; } }