From eb8b887d32ae1f8fb7fa3357872d1d3d7ebf360b Mon Sep 17 00:00:00 2001 From: Julien Couvreur Date: Tue, 20 Jun 2023 15:09:50 -0700 Subject: [PATCH] Rename --- .../Portable/Symbols/ObsoleteAttributeHelpers.cs | 6 +++--- src/Compilers/CSharp/Portable/Symbols/Symbol.cs | 2 +- .../CSharp/Portable/Symbols/Symbol_Attributes.cs | 8 ++++---- .../Attributes/AttributeTests_Experimental.cs | 2 +- .../Core/Portable/MetadataReader/PEModule.cs | 16 ++++++++-------- .../Symbols/Attributes/AttributeDescription.cs | 4 ++-- .../Symbols/Attributes/CommonAttributeData.cs | 14 +++++++------- .../Symbols/Attributes/ObsoleteAttributeData.cs | 4 ++-- .../Portable/Symbols/ObsoleteAttributeHelpers.vb | 6 +++--- .../Symbols/Source/QuickAttributeChecker.vb | 4 ++-- .../Symbols/Source/SourceModuleSymbol.vb | 2 +- .../Symbols/Source/SourceNamedTypeSymbol.vb | 2 +- .../VisualBasic/Portable/Symbols/Symbol.vb | 2 +- .../Portable/Symbols/Symbol_Attributes.vb | 4 ++-- .../Attributes/AttributeTests_Experimental.vb | 2 +- 15 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/Compilers/CSharp/Portable/Symbols/ObsoleteAttributeHelpers.cs b/src/Compilers/CSharp/Portable/Symbols/ObsoleteAttributeHelpers.cs index 4c629b727670e..aecf37a20cc30 100644 --- a/src/Compilers/CSharp/Portable/Symbols/ObsoleteAttributeHelpers.cs +++ b/src/Compilers/CSharp/Portable/Symbols/ObsoleteAttributeHelpers.cs @@ -99,8 +99,8 @@ internal static ObsoleteDiagnosticKind GetObsoleteDiagnosticKind(Symbol symbol, { case ObsoleteAttributeKind.None: return ObsoleteDiagnosticKind.NotObsolete; + case ObsoleteAttributeKind.WindowsExperimental: case ObsoleteAttributeKind.Experimental: - case ObsoleteAttributeKind.NewExperimental: return ObsoleteDiagnosticKind.Diagnostic; case ObsoleteAttributeKind.Uninitialized: // If we haven't cracked attributes on the symbol at all or we haven't @@ -155,7 +155,7 @@ static DiagnosticInfo createObsoleteDiagnostic(Symbol symbol, BinderFlags locati return null; } - if (data.Kind == ObsoleteAttributeKind.Experimental) + if (data.Kind == ObsoleteAttributeKind.WindowsExperimental) { Debug.Assert(data.Message == null); Debug.Assert(!data.IsError); @@ -163,7 +163,7 @@ static DiagnosticInfo createObsoleteDiagnostic(Symbol symbol, BinderFlags locati return new CSDiagnosticInfo(ErrorCode.WRN_Experimental, new FormattedSymbol(symbol, SymbolDisplayFormat.CSharpErrorMessageFormat)); } - if (data.Kind == ObsoleteAttributeKind.NewExperimental) + if (data.Kind == ObsoleteAttributeKind.Experimental) { Debug.Assert(data.Message is null); Debug.Assert(!data.IsError); diff --git a/src/Compilers/CSharp/Portable/Symbols/Symbol.cs b/src/Compilers/CSharp/Portable/Symbols/Symbol.cs index 519d0471901c8..0eff024ab0ed5 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Symbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Symbol.cs @@ -1320,8 +1320,8 @@ internal ThreeState ObsoleteState switch (ObsoleteKind) { case ObsoleteAttributeKind.None: + case ObsoleteAttributeKind.WindowsExperimental: case ObsoleteAttributeKind.Experimental: - case ObsoleteAttributeKind.NewExperimental: return ThreeState.False; case ObsoleteAttributeKind.Uninitialized: return ThreeState.Unknown; diff --git a/src/Compilers/CSharp/Portable/Symbols/Symbol_Attributes.cs b/src/Compilers/CSharp/Portable/Symbols/Symbol_Attributes.cs index 599a60b520b25..cede809659f7a 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Symbol_Attributes.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Symbol_Attributes.cs @@ -162,13 +162,13 @@ internal static bool EarlyDecodeDeprecatedOrExperimentalOrObsoleteAttribute( { kind = ObsoleteAttributeKind.Deprecated; } - else if (CSharpAttributeData.IsTargetEarlyAttribute(type, syntax, AttributeDescription.ExperimentalAttribute)) + else if (CSharpAttributeData.IsTargetEarlyAttribute(type, syntax, AttributeDescription.WindowsExperimentalAttribute)) { - kind = ObsoleteAttributeKind.Experimental; + kind = ObsoleteAttributeKind.WindowsExperimental; } - else if (CSharpAttributeData.IsTargetEarlyAttribute(type, syntax, AttributeDescription.NewExperimentalAttribute)) + else if (CSharpAttributeData.IsTargetEarlyAttribute(type, syntax, AttributeDescription.ExperimentalAttribute)) { - kind = ObsoleteAttributeKind.NewExperimental; + kind = ObsoleteAttributeKind.Experimental; } else { diff --git a/src/Compilers/CSharp/Test/Emit2/Attributes/AttributeTests_Experimental.cs b/src/Compilers/CSharp/Test/Emit2/Attributes/AttributeTests_Experimental.cs index 43763951ad049..1fab435c09b03 100644 --- a/src/Compilers/CSharp/Test/Emit2/Attributes/AttributeTests_Experimental.cs +++ b/src/Compilers/CSharp/Test/Emit2/Attributes/AttributeTests_Experimental.cs @@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.CSharp.UnitTests { - public class AttributeTests_Experimental : CSharpTestBase + public class AttributeTests_WindowsExperimental : CSharpTestBase { private const string DeprecatedAttributeSource = @"using System; diff --git a/src/Compilers/Core/Portable/MetadataReader/PEModule.cs b/src/Compilers/Core/Portable/MetadataReader/PEModule.cs index 96dce7cd00498..881353b0708ac 100644 --- a/src/Compilers/Core/Portable/MetadataReader/PEModule.cs +++ b/src/Compilers/Core/Portable/MetadataReader/PEModule.cs @@ -1164,24 +1164,24 @@ internal ObsoleteAttributeData TryGetDeprecatedOrExperimentalOrObsoleteAttribute } // [Windows.Foundation.Metadata.Experimental] is always a warning, not an error. - info = FindTargetAttribute(token, AttributeDescription.ExperimentalAttribute); + info = FindTargetAttribute(token, AttributeDescription.WindowsExperimentalAttribute); if (info.HasValue) { - return TryExtractExperimentalDataFromAttribute(info); + return TryExtractWindowsExperimentalDataFromAttribute(info); } // [Experimental] is always a warning, not an error, so search for it last. - info = FindTargetAttribute(token, AttributeDescription.NewExperimentalAttribute); + info = FindTargetAttribute(token, AttributeDescription.ExperimentalAttribute); if (info.HasValue) { - return TryExtractNewExperimentalDataFromAttribute(info, decoder); + return TryExtractExperimentalDataFromAttribute(info, decoder); } return null; } #nullable enable - private ObsoleteAttributeData? TryExtractNewExperimentalDataFromAttribute(AttributeInfo attributeInfo, IAttributeNamedArgumentDecoder decoder) + private ObsoleteAttributeData? TryExtractExperimentalDataFromAttribute(AttributeInfo attributeInfo, IAttributeNamedArgumentDecoder decoder) { Debug.Assert(attributeInfo.HasValue); if (!TryGetAttributeReader(attributeInfo.Handle, out var sig)) @@ -1202,7 +1202,7 @@ internal ObsoleteAttributeData TryGetDeprecatedOrExperimentalOrObsoleteAttribute } string? urlFormat = crackUrlFormat(decoder, ref sig); - return new ObsoleteAttributeData(ObsoleteAttributeKind.NewExperimental, message: null, isError: false, diagnosticId, urlFormat); + return new ObsoleteAttributeData(ObsoleteAttributeKind.Experimental, message: null, isError: false, diagnosticId, urlFormat); static string? crackUrlFormat(IAttributeNamedArgumentDecoder decoder, ref BlobReader sig) { @@ -1692,14 +1692,14 @@ private ObsoleteAttributeData TryExtractDeprecatedDataFromAttribute(AttributeInf } } - private ObsoleteAttributeData TryExtractExperimentalDataFromAttribute(AttributeInfo attributeInfo) + private ObsoleteAttributeData TryExtractWindowsExperimentalDataFromAttribute(AttributeInfo attributeInfo) { Debug.Assert(attributeInfo.HasValue); switch (attributeInfo.SignatureIndex) { case 0: // ExperimentalAttribute() - return ObsoleteAttributeData.Experimental; + return ObsoleteAttributeData.WindowsExperimental; default: throw ExceptionUtilities.UnexpectedValue(attributeInfo.SignatureIndex); diff --git a/src/Compilers/Core/Portable/Symbols/Attributes/AttributeDescription.cs b/src/Compilers/Core/Portable/Symbols/Attributes/AttributeDescription.cs index 4ddbdf5a6d7da..f2066cc984cc3 100644 --- a/src/Compilers/Core/Portable/Symbols/Attributes/AttributeDescription.cs +++ b/src/Compilers/Core/Portable/Symbols/Attributes/AttributeDescription.cs @@ -464,8 +464,8 @@ static AttributeDescription() internal static readonly AttributeDescription NullableAttribute = new AttributeDescription("System.Runtime.CompilerServices", "NullableAttribute", s_signaturesOfNullableAttribute); internal static readonly AttributeDescription NullableContextAttribute = new AttributeDescription("System.Runtime.CompilerServices", "NullableContextAttribute", s_signaturesOfNullableContextAttribute); internal static readonly AttributeDescription NullablePublicOnlyAttribute = new AttributeDescription("System.Runtime.CompilerServices", "NullablePublicOnlyAttribute", s_signatures_HasThis_Void_Boolean_Only); - internal static readonly AttributeDescription ExperimentalAttribute = new AttributeDescription("Windows.Foundation.Metadata", "ExperimentalAttribute", s_signatures_HasThis_Void_Only); - internal static readonly AttributeDescription NewExperimentalAttribute = new AttributeDescription("System.Diagnostics.CodeAnalysis", "ExperimentalAttribute", s_signatures_HasThis_Void_String_Only); + internal static readonly AttributeDescription WindowsExperimentalAttribute = new AttributeDescription("Windows.Foundation.Metadata", "ExperimentalAttribute", s_signatures_HasThis_Void_Only); + internal static readonly AttributeDescription ExperimentalAttribute = new AttributeDescription("System.Diagnostics.CodeAnalysis", "ExperimentalAttribute", s_signatures_HasThis_Void_String_Only); internal static readonly AttributeDescription ExcludeFromCodeCoverageAttribute = new AttributeDescription("System.Diagnostics.CodeAnalysis", "ExcludeFromCodeCoverageAttribute", s_signatures_HasThis_Void_Only); internal static readonly AttributeDescription EnumeratorCancellationAttribute = new AttributeDescription("System.Runtime.CompilerServices", "EnumeratorCancellationAttribute", s_signatures_HasThis_Void_Only); internal static readonly AttributeDescription SkipLocalsInitAttribute = new AttributeDescription("System.Runtime.CompilerServices", "SkipLocalsInitAttribute", s_signatures_HasThis_Void_Only); diff --git a/src/Compilers/Core/Portable/Symbols/Attributes/CommonAttributeData.cs b/src/Compilers/Core/Portable/Symbols/Attributes/CommonAttributeData.cs index 901a4d756869a..2fe5edd56088e 100644 --- a/src/Compilers/Core/Portable/Symbols/Attributes/CommonAttributeData.cs +++ b/src/Compilers/Core/Portable/Symbols/Attributes/CommonAttributeData.cs @@ -255,15 +255,15 @@ internal ObsoleteAttributeData DecodeObsoleteAttribute(ObsoleteAttributeKind kin return DecodeObsoleteAttribute(); case ObsoleteAttributeKind.Deprecated: return DecodeDeprecatedAttribute(); + case ObsoleteAttributeKind.WindowsExperimental: + return DecodeWindowsExperimentalAttribute(); case ObsoleteAttributeKind.Experimental: - return DecodeExperimentalAttribute(); - case ObsoleteAttributeKind.NewExperimental: - return decodeNewExperimentalAttribute(); + return decodeExperimentalAttribute(); default: throw ExceptionUtilities.UnexpectedValue(kind); } - ObsoleteAttributeData decodeNewExperimentalAttribute() + ObsoleteAttributeData decodeExperimentalAttribute() { // ExperimentalAttribute(string diagnosticId) Debug.Assert(this.CommonConstructorArguments.Length == 1); @@ -283,7 +283,7 @@ ObsoleteAttributeData decodeNewExperimentalAttribute() } } - return new ObsoleteAttributeData(ObsoleteAttributeKind.NewExperimental, message: null, isError: false, diagnosticId, urlFormat); + return new ObsoleteAttributeData(ObsoleteAttributeKind.Experimental, message: null, isError: false, diagnosticId, urlFormat); } } @@ -372,11 +372,11 @@ private ObsoleteAttributeData DecodeDeprecatedAttribute() /// /// Decode the arguments to ExperimentalAttribute. ExperimentalAttribute has 0 arguments. /// - private ObsoleteAttributeData DecodeExperimentalAttribute() + private ObsoleteAttributeData DecodeWindowsExperimentalAttribute() { // ExperimentalAttribute() Debug.Assert(this.CommonConstructorArguments.Length == 0); - return ObsoleteAttributeData.Experimental; + return ObsoleteAttributeData.WindowsExperimental; } internal static void DecodeMethodImplAttribute( diff --git a/src/Compilers/Core/Portable/Symbols/Attributes/ObsoleteAttributeData.cs b/src/Compilers/Core/Portable/Symbols/Attributes/ObsoleteAttributeData.cs index 9a7f2ca264963..67d7d4da7c831 100644 --- a/src/Compilers/Core/Portable/Symbols/Attributes/ObsoleteAttributeData.cs +++ b/src/Compilers/Core/Portable/Symbols/Attributes/ObsoleteAttributeData.cs @@ -12,8 +12,8 @@ internal enum ObsoleteAttributeKind Uninitialized, Obsolete, Deprecated, + WindowsExperimental, Experimental, - NewExperimental, } /// @@ -22,7 +22,7 @@ internal enum ObsoleteAttributeKind internal sealed class ObsoleteAttributeData { public static readonly ObsoleteAttributeData Uninitialized = new ObsoleteAttributeData(ObsoleteAttributeKind.Uninitialized, message: null, isError: false, diagnosticId: null, urlFormat: null); - public static readonly ObsoleteAttributeData Experimental = new ObsoleteAttributeData(ObsoleteAttributeKind.Experimental, message: null, isError: false, diagnosticId: null, urlFormat: null); + public static readonly ObsoleteAttributeData WindowsExperimental = new ObsoleteAttributeData(ObsoleteAttributeKind.WindowsExperimental, message: null, isError: false, diagnosticId: null, urlFormat: null); public const string DiagnosticIdPropertyName = "DiagnosticId"; public const string UrlFormatPropertyName = "UrlFormat"; diff --git a/src/Compilers/VisualBasic/Portable/Symbols/ObsoleteAttributeHelpers.vb b/src/Compilers/VisualBasic/Portable/Symbols/ObsoleteAttributeHelpers.vb index b9efa63fc9602..12539703f7f75 100644 --- a/src/Compilers/VisualBasic/Portable/Symbols/ObsoleteAttributeHelpers.vb +++ b/src/Compilers/VisualBasic/Portable/Symbols/ObsoleteAttributeHelpers.vb @@ -75,7 +75,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols Select Case symbol.ObsoleteKind Case ObsoleteAttributeKind.None Return ObsoleteDiagnosticKind.NotObsolete - Case ObsoleteAttributeKind.Experimental, ObsoleteAttributeKind.NewExperimental + Case ObsoleteAttributeKind.WindowsExperimental, ObsoleteAttributeKind.Experimental Return ObsoleteDiagnosticKind.Diagnostic Case ObsoleteAttributeKind.Uninitialized ' If we haven't cracked attributes on the symbol at all or we haven't @@ -115,7 +115,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols ' uninitialized. Debug.Assert(Not data.IsUninitialized) - If data.Kind = ObsoleteAttributeKind.Experimental Then + If data.Kind = ObsoleteAttributeKind.WindowsExperimental Then Debug.Assert(data.Message Is Nothing) Debug.Assert(Not data.IsError) ' Provide an explicit format for fully-qualified type names. @@ -123,7 +123,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols End If - If data.Kind = ObsoleteAttributeKind.NewExperimental Then + If data.Kind = ObsoleteAttributeKind.Experimental Then Debug.Assert(data.Message Is Nothing) Debug.Assert(Not data.IsError) ' Provide an explicit format for fully-qualified type names. diff --git a/src/Compilers/VisualBasic/Portable/Symbols/Source/QuickAttributeChecker.vb b/src/Compilers/VisualBasic/Portable/Symbols/Source/QuickAttributeChecker.vb index 5c9eed809dc0b..e2c9c1a61bb3c 100644 --- a/src/Compilers/VisualBasic/Portable/Symbols/Source/QuickAttributeChecker.vb +++ b/src/Compilers/VisualBasic/Portable/Symbols/Source/QuickAttributeChecker.vb @@ -155,9 +155,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols result = result Or QuickAttributes.Obsolete ElseIf Matches(name, inAttribute, AttributeDescription.DeprecatedAttribute) Then result = result Or QuickAttributes.Obsolete - ElseIf Matches(name, inAttribute, AttributeDescription.ExperimentalAttribute) Then + ElseIf Matches(name, inAttribute, AttributeDescription.WindowsExperimentalAttribute) Then result = result Or QuickAttributes.Obsolete - ElseIf Matches(name, inAttribute, AttributeDescription.NewExperimentalAttribute) Then + ElseIf Matches(name, inAttribute, AttributeDescription.ExperimentalAttribute) Then result = result Or QuickAttributes.Obsolete ElseIf Matches(name, inAttribute, AttributeDescription.MyGroupCollectionAttribute) Then result = result Or QuickAttributes.TypeIdentifier diff --git a/src/Compilers/VisualBasic/Portable/Symbols/Source/SourceModuleSymbol.vb b/src/Compilers/VisualBasic/Portable/Symbols/Source/SourceModuleSymbol.vb index c3c9452d15149..14518f97dae13 100644 --- a/src/Compilers/VisualBasic/Portable/Symbols/Source/SourceModuleSymbol.vb +++ b/src/Compilers/VisualBasic/Portable/Symbols/Source/SourceModuleSymbol.vb @@ -328,8 +328,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols checker.AddName(AttributeDescription.CaseInsensitiveExtensionAttribute.Name, QuickAttributes.Extension) checker.AddName(AttributeDescription.ObsoleteAttribute.Name, QuickAttributes.Obsolete) checker.AddName(AttributeDescription.DeprecatedAttribute.Name, QuickAttributes.Obsolete) + checker.AddName(AttributeDescription.WindowsExperimentalAttribute.Name, QuickAttributes.Obsolete) checker.AddName(AttributeDescription.ExperimentalAttribute.Name, QuickAttributes.Obsolete) - checker.AddName(AttributeDescription.NewExperimentalAttribute.Name, QuickAttributes.Obsolete) checker.AddName(AttributeDescription.MyGroupCollectionAttribute.Name, QuickAttributes.MyGroupCollection) checker.AddName(AttributeDescription.TypeIdentifierAttribute.Name, QuickAttributes.TypeIdentifier) diff --git a/src/Compilers/VisualBasic/Portable/Symbols/Source/SourceNamedTypeSymbol.vb b/src/Compilers/VisualBasic/Portable/Symbols/Source/SourceNamedTypeSymbol.vb index 5a24eadf5c111..f83bc35613404 100644 --- a/src/Compilers/VisualBasic/Portable/Symbols/Source/SourceNamedTypeSymbol.vb +++ b/src/Compilers/VisualBasic/Portable/Symbols/Source/SourceNamedTypeSymbol.vb @@ -1817,8 +1817,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols Case AttributeDescription.CaseInsensitiveExtensionAttribute.Name, AttributeDescription.ObsoleteAttribute.Name, AttributeDescription.DeprecatedAttribute.Name, + AttributeDescription.WindowsExperimentalAttribute.Name, AttributeDescription.ExperimentalAttribute.Name, - AttributeDescription.NewExperimentalAttribute.Name, AttributeDescription.MyGroupCollectionAttribute.Name, AttributeDescription.TypeIdentifierAttribute.Name diff --git a/src/Compilers/VisualBasic/Portable/Symbols/Symbol.vb b/src/Compilers/VisualBasic/Portable/Symbols/Symbol.vb index 599465537a6e3..9771862391d5d 100644 --- a/src/Compilers/VisualBasic/Portable/Symbols/Symbol.vb +++ b/src/Compilers/VisualBasic/Portable/Symbols/Symbol.vb @@ -446,7 +446,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Friend ReadOnly Property ObsoleteState As ThreeState Get Select Case ObsoleteKind - Case ObsoleteAttributeKind.None, ObsoleteAttributeKind.Experimental, ObsoleteAttributeKind.NewExperimental + Case ObsoleteAttributeKind.None, ObsoleteAttributeKind.WindowsExperimental, ObsoleteAttributeKind.Experimental Return ThreeState.False Case ObsoleteAttributeKind.Uninitialized Return ThreeState.Unknown diff --git a/src/Compilers/VisualBasic/Portable/Symbols/Symbol_Attributes.vb b/src/Compilers/VisualBasic/Portable/Symbols/Symbol_Attributes.vb index 82124d451b9bb..924870153f8cd 100644 --- a/src/Compilers/VisualBasic/Portable/Symbols/Symbol_Attributes.vb +++ b/src/Compilers/VisualBasic/Portable/Symbols/Symbol_Attributes.vb @@ -156,10 +156,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic kind = ObsoleteAttributeKind.Obsolete ElseIf VisualBasicAttributeData.IsTargetEarlyAttribute(type, syntax, AttributeDescription.DeprecatedAttribute) Then kind = ObsoleteAttributeKind.Deprecated + ElseIf VisualBasicAttributeData.IsTargetEarlyAttribute(type, syntax, AttributeDescription.WindowsExperimentalAttribute) Then + kind = ObsoleteAttributeKind.WindowsExperimental ElseIf VisualBasicAttributeData.IsTargetEarlyAttribute(type, syntax, AttributeDescription.ExperimentalAttribute) Then kind = ObsoleteAttributeKind.Experimental - ElseIf VisualBasicAttributeData.IsTargetEarlyAttribute(type, syntax, AttributeDescription.NewExperimentalAttribute) Then - kind = ObsoleteAttributeKind.NewExperimental Else boundAttribute = Nothing obsoleteData = Nothing diff --git a/src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Experimental.vb b/src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Experimental.vb index a778be9564a78..af0f0b616f251 100644 --- a/src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Experimental.vb +++ b/src/Compilers/VisualBasic/Test/Emit/Attributes/AttributeTests_Experimental.vb @@ -9,7 +9,7 @@ Imports Xunit Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.Semantics - Public Class AttributeTests_Experimental + Public Class AttributeTests_WindowsExperimental Inherits BasicTestBase Private Shared ReadOnly DeprecatedAndExperimentalAttributeSource As XElement =