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
public interface IDerived : IBase1, IBase2 public interface IDerived : IBase1, IBase2
{ {
int Prop { get; set; } new int Prop { get; set; }
} }
public class ClassWithVirtualProperty public class ClassWithVirtualProperty

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

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

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

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

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

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

4
ICSharpCode.Decompiler/Semantics/MemberResolveResult.cs

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

6
ICSharpCode.Decompiler/TypeSystem/IEntity.cs

@ -148,11 +148,5 @@ namespace ICSharpCode.Decompiler.TypeSystem
/// </summary> /// </summary>
/// <remarks>Static classes also count as sealed classes.</remarks> /// <remarks>Static classes also count as sealed classes.</remarks>
bool IsSealed { get; } 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
/// Gets whether this field is volatile. /// Gets whether this field is volatile.
/// </summary> /// </summary>
bool IsVolatile { get; } 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
public bool IsStatic { get; set; } public bool IsStatic { get; set; }
bool IEntity.IsAbstract => false; bool IEntity.IsAbstract => false;
bool IEntity.IsSealed => false; bool IEntity.IsSealed => false;
bool IEntity.IsShadowing => false;
public abstract SymbolKind SymbolKind { get; } public abstract SymbolKind SymbolKind { get; }
@ -107,7 +106,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
bool IField.IsReadOnly => false; bool IField.IsReadOnly => false;
bool IField.IsVolatile => false; bool IField.IsVolatile => false;
bool IField.IsFixed => false;
bool IVariable.IsConst => false; bool IVariable.IsConst => false;
object IVariable.ConstantValue => null; object IVariable.ConstantValue => null;

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

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

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

@ -79,14 +79,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
public Accessibility Accessibility => MetadataLoader.GetAccessibility(attributes); public Accessibility Accessibility => MetadataLoader.GetAccessibility(attributes);
public bool IsReadOnly => (attributes & FieldAttributes.InitOnly) != 0; public bool IsReadOnly => (attributes & FieldAttributes.InitOnly) != 0;
public bool IsStatic => (attributes & FieldAttributes.Static) != 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; SymbolKind ISymbol.SymbolKind => SymbolKind.Field;
IMember IMember.MemberDefinition => this; IMember IMember.MemberDefinition => this;
TypeParameterSubstitution IMember.Substitution => TypeParameterSubstitution.Identity; TypeParameterSubstitution IMember.Substitution => TypeParameterSubstitution.Identity;

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

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

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

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

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

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

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

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

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

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

4
ICSharpCode.Decompiler/TypeSystem/VarArgInstanceMethod.cs

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

Loading…
Cancel
Save