Browse Source

Remove unimplemented IMember.IsShadowing and IField.IsFixed.

pull/1198/head
Daniel Grunwald 7 years ago
parent
commit
97fc614db5
  1. 2
      ICSharpCode.Decompiler.Tests/TypeSystem/TypeSystemTestCase.cs
  2. 4
      ICSharpCode.Decompiler/CSharp/Resolver/CSharpOperators.cs
  3. 8
      ICSharpCode.Decompiler/CSharp/Resolver/ReducedExtensionMethod.cs
  4. 5
      ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs
  5. 4
      ICSharpCode.Decompiler/Semantics/MemberResolveResult.cs
  6. 6
      ICSharpCode.Decompiler/TypeSystem/IEntity.cs
  7. 6
      ICSharpCode.Decompiler/TypeSystem/IField.cs
  8. 2
      ICSharpCode.Decompiler/TypeSystem/Implementation/FakeMember.cs
  9. 2
      ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataEvent.cs
  10. 9
      ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataField.cs
  11. 2
      ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataMethod.cs
  12. 2
      ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataProperty.cs
  13. 2
      ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataTypeDefinition.cs
  14. 4
      ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedField.cs
  15. 4
      ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedMember.cs
  16. 4
      ICSharpCode.Decompiler/TypeSystem/VarArgInstanceMethod.cs

2
ICSharpCode.Decompiler.Tests/TypeSystem/TypeSystemTestCase.cs

@ -272,7 +272,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -272,7 +272,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
public interface IDerived : IBase1, IBase2
{
int Prop { get; set; }
new int Prop { get; set; }
}
public class ClassWithVirtualProperty

4
ICSharpCode.Decompiler/CSharp/Resolver/CSharpOperators.cs

@ -170,10 +170,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver @@ -170,10 +170,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver
get { return false; }
}
bool IEntity.IsShadowing {
get { return false; }
}
bool IMember.IsExplicitInterfaceImplementation {
get { return false; }
}

8
ICSharpCode.Decompiler/CSharp/Resolver/ReducedExtensionMethod.cs

@ -266,13 +266,7 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver @@ -266,13 +266,7 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver
return baseMethod.IsSealed;
}
}
public bool IsShadowing {
get {
return baseMethod.IsShadowing;
}
}
#endregion
#region IHasAccessibility implementation

5
ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs

@ -873,9 +873,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -873,9 +873,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
} else if (typeDefinition.IsSealed) {
modifiers |= Modifiers.Sealed;
}
if (typeDefinition.IsShadowing) {
modifiers |= Modifiers.New;
}
}
ClassType classType;
@ -1268,8 +1265,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -1268,8 +1265,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
if (member.IsSealed)
m |= Modifiers.Sealed;
}
if (member.IsShadowing)
m |= Modifiers.New;
}
return m;
}

4
ICSharpCode.Decompiler/Semantics/MemberResolveResult.cs

@ -72,8 +72,8 @@ namespace ICSharpCode.Decompiler.Semantics @@ -72,8 +72,8 @@ namespace ICSharpCode.Decompiler.Semantics
case SymbolKind.Constructor:
return member.DeclaringType ?? SpecialType.UnknownType;
case SymbolKind.Field:
if (((IField)member).IsFixed)
return new PointerType(member.ReturnType);
//if (((IField)member).IsFixed)
// return new PointerType(member.ReturnType);
break;
}
if (member.ReturnType.Kind == TypeKind.ByReference)

6
ICSharpCode.Decompiler/TypeSystem/IEntity.cs

@ -148,11 +148,5 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -148,11 +148,5 @@ namespace ICSharpCode.Decompiler.TypeSystem
/// </summary>
/// <remarks>Static classes also count as sealed classes.</remarks>
bool IsSealed { get; }
/// <summary>
/// Gets whether this member is declared to be shadowing another member with the same name.
/// (C# 'new' keyword)
/// </summary>
bool IsShadowing { get; }
}
}

6
ICSharpCode.Decompiler/TypeSystem/IField.cs

@ -79,11 +79,5 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -79,11 +79,5 @@ namespace ICSharpCode.Decompiler.TypeSystem
/// Gets whether this field is volatile.
/// </summary>
bool IsVolatile { get; }
/// <summary>
/// Gets whether this field is a fixed size buffer (C#-like fixed).
/// If this is true, then ConstantValue contains the size of the buffer.
/// </summary>
bool IsFixed { get; }
}
}

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

@ -65,7 +65,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -65,7 +65,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
public bool IsStatic { get; set; }
bool IEntity.IsAbstract => false;
bool IEntity.IsSealed => false;
bool IEntity.IsShadowing => false;
public abstract SymbolKind SymbolKind { get; }
@ -107,7 +106,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -107,7 +106,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
bool IField.IsReadOnly => false;
bool IField.IsVolatile => false;
bool IField.IsFixed => false;
bool IVariable.IsConst => false;
object IVariable.ConstantValue => null;

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

@ -130,8 +130,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -130,8 +130,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
public bool IsOverride => AnyAccessor?.IsOverride ?? false;
public bool IsOverridable => AnyAccessor?.IsOverridable ?? false;
bool IEntity.IsShadowing => AnyAccessor?.IsShadowing ?? false;
public IAssembly ParentAssembly => assembly;
public ICompilation Compilation => assembly.Compilation;

9
ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataField.cs

@ -79,14 +79,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -79,14 +79,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
public Accessibility Accessibility => MetadataLoader.GetAccessibility(attributes);
public bool IsReadOnly => (attributes & FieldAttributes.InitOnly) != 0;
public bool IsStatic => (attributes & FieldAttributes.Static) != 0;
// not sure if we need IsFixed anywhere...
bool IField.IsFixed => false;
// Do we still want IsShadowing in the TS?
// We never set it for assemblies loaded from disk; only for those parsed from C#...
bool IEntity.IsShadowing => false;
SymbolKind ISymbol.SymbolKind => SymbolKind.Field;
IMember IMember.MemberDefinition => this;
TypeParameterSubstitution IMember.Substitution => TypeParameterSubstitution.Identity;

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

@ -422,8 +422,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -422,8 +422,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
=> (attributes & (MethodAttributes.Abstract | MethodAttributes.Virtual)) != 0
&& (attributes & MethodAttributes.Final) == 0;
bool IEntity.IsShadowing => false;
public string FullName => $"{DeclaringType?.FullName}.{Name}";
public string ReflectionName => $"{DeclaringType?.ReflectionName}.{Name}";
public string Namespace => DeclaringType?.Namespace ?? string.Empty;

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

@ -222,8 +222,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -222,8 +222,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
public bool IsOverride => AnyAccessor?.IsOverride ?? false;
public bool IsOverridable => AnyAccessor?.IsOverridable ?? false;
bool IEntity.IsShadowing => AnyAccessor?.IsShadowing ?? false;
public IAssembly ParentAssembly => assembly;
public ICompilation Compilation => assembly.Compilation;

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

@ -405,8 +405,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -405,8 +405,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
public bool IsAbstract => (attributes & TypeAttributes.Abstract) != 0;
public bool IsSealed => (attributes & TypeAttributes.Sealed) != 0;
bool IEntity.IsShadowing => false;
public SymbolKind SymbolKind => SymbolKind.TypeDefinition;
public ICompilation Compilation => assembly.Compilation;

4
ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedField.cs

@ -60,10 +60,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -60,10 +60,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
get { return fieldDefinition.IsConst; }
}
public bool IsFixed {
get { return fieldDefinition.IsFixed; }
}
public object ConstantValue {
get { return fieldDefinition.ConstantValue; }
}

4
ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedMember.cs

@ -183,10 +183,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -183,10 +183,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
get { return baseMember.IsSealed; }
}
public bool IsShadowing {
get { return baseMember.IsShadowing; }
}
public string FullName {
get { return baseMember.FullName; }
}

4
ICSharpCode.Decompiler/TypeSystem/VarArgInstanceMethod.cs

@ -241,10 +241,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -241,10 +241,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
get { return baseMethod.IsSealed; }
}
public bool IsShadowing {
get { return baseMethod.IsShadowing; }
}
#endregion
#region IHasAccessibility implementation

Loading…
Cancel
Save