From 93953456d1cfb157e25183be71785bdea3b16d84 Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Thu, 15 Jun 2023 16:26:00 +0200 Subject: [PATCH] Suppress obsolete warnings --- .../CSharp/Portable/Symbols/Metadata/PE/PEFieldSymbol.cs | 2 ++ .../CSharp/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.cs | 2 ++ .../VisualBasic/Portable/Symbols/Metadata/PE/PEFieldSymbol.vb | 2 ++ .../Portable/Symbols/Metadata/PE/PENamedTypeSymbol.vb | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEFieldSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEFieldSymbol.cs index 6c5843faa621a..ca5bc67794aa9 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEFieldSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEFieldSymbol.cs @@ -216,7 +216,9 @@ internal override bool IsNotSerialized { get { +#pragma warning disable SYSLIB0050 // 'TypeAttributes.Serializable' is obsolete return (_flags & FieldAttributes.NotSerialized) != 0; +#pragma warning restore SYSLIB0050 } } diff --git a/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.cs index 89868874bcd87..3c48950581c5f 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.cs @@ -2240,7 +2240,9 @@ internal override CharSet MarshallingCharSet public override bool IsSerializable { +#pragma warning disable SYSLIB0050 // 'TypeAttributes.Serializable' is obsolete get { return (_flags & TypeAttributes.Serializable) != 0; } +#pragma warning restore SYSLIB0050 } public override bool IsRefLikeType diff --git a/src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/PEFieldSymbol.vb b/src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/PEFieldSymbol.vb index 45e323c4448d9..08d6707ef54b7 100644 --- a/src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/PEFieldSymbol.vb +++ b/src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/PEFieldSymbol.vb @@ -206,7 +206,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols.Metadata.PE Friend Overrides ReadOnly Property IsNotSerialized As Boolean Get +#Disable Warning SYSLIB0050 ' 'TypeAttributes.Serializable' is obsolete Return (_flags And FieldAttributes.NotSerialized) <> 0 +#Enable Warning SYSLIB0050 End Get End Property diff --git a/src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.vb b/src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.vb index 18cd55d9a2149..a7d23650814bc 100644 --- a/src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.vb +++ b/src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.vb @@ -220,7 +220,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols.Metadata.PE Public Overrides ReadOnly Property IsSerializable As Boolean Get +#Disable Warning SYSLIB0050 ' 'TypeAttributes.Serializable' is obsolete Return (_flags And TypeAttributes.Serializable) <> 0 +#Enable Warning SYSLIB0050 End Get End Property