提交 6a688b0f 编写于 作者: O Omar Tawfik 提交者: vsadov

Replace IsConst modreq with InAttribute

Fixes #19950
上级 2401959c
...@@ -304,9 +304,9 @@ private sealed class PEParameterSymbolWithCustomModifiers : PEParameterSymbol ...@@ -304,9 +304,9 @@ private sealed class PEParameterSymbolWithCustomModifiers : PEParameterSymbol
_customModifiers = CSharpCustomModifier.Convert(customModifiers); _customModifiers = CSharpCustomModifier.Convert(customModifiers);
_refCustomModifiers = CSharpCustomModifier.Convert(refCustomModifiers); _refCustomModifiers = CSharpCustomModifier.Convert(refCustomModifiers);
if (this.RefKind != RefKind.RefReadOnly && _refCustomModifiers.Any(modifier => !modifier.IsOptional && modifier.Modifier.IsWellKnownTypeIsConst())) if (this.RefKind != RefKind.RefReadOnly && _refCustomModifiers.Any(modifier => !modifier.IsOptional && modifier.Modifier.IsWellKnownTypeInAttribute()))
{ {
// IsConst modreq is only accepted on RefReadOnly symbols // The modreq is only accepted on RefReadOnly symbols
isBad = true; isBad = true;
} }
......
...@@ -742,8 +742,8 @@ private sealed class PEPropertySymbolWithCustomModifiers : PEPropertySymbol ...@@ -742,8 +742,8 @@ private sealed class PEPropertySymbolWithCustomModifiers : PEPropertySymbol
_typeCustomModifiers = CSharpCustomModifier.Convert(returnInfo.CustomModifiers); _typeCustomModifiers = CSharpCustomModifier.Convert(returnInfo.CustomModifiers);
_refCustomModifiers = CSharpCustomModifier.Convert(returnInfo.RefCustomModifiers); _refCustomModifiers = CSharpCustomModifier.Convert(returnInfo.RefCustomModifiers);
// IsConst modreq is only accepted on RefReadOnly symbols // The modreq is only accepted on RefReadOnly symbols
isBad = this.RefKind != RefKind.RefReadOnly && _refCustomModifiers.Any(modifier => !modifier.IsOptional && modifier.Modifier.IsWellKnownTypeIsConst()); isBad = this.RefKind != RefKind.RefReadOnly && _refCustomModifiers.Any(modifier => !modifier.IsOptional && modifier.Modifier.IsWellKnownTypeInAttribute());
} }
public override ImmutableArray<CustomModifier> TypeCustomModifiers public override ImmutableArray<CustomModifier> TypeCustomModifiers
......
...@@ -57,9 +57,9 @@ internal override bool IsAcceptedVolatileModifierType(PEModuleSymbol moduleSymbo ...@@ -57,9 +57,9 @@ internal override bool IsAcceptedVolatileModifierType(PEModuleSymbol moduleSymbo
return type.SpecialType == SpecialType.System_Runtime_CompilerServices_IsVolatile; return type.SpecialType == SpecialType.System_Runtime_CompilerServices_IsVolatile;
} }
internal override bool IsAcceptedIsConstModifierType(TypeSymbol type) internal override bool IsAcceptedInAttributeModifierType(TypeSymbol type)
{ {
return type.IsWellKnownTypeIsConst(); return type.IsWellKnownTypeInAttribute();
} }
internal override TypeSymbol GetSZArrayTypeSymbol(PEModuleSymbol moduleSymbol, TypeSymbol elementType, ImmutableArray<ModifierInfo<TypeSymbol>> customModifiers) internal override TypeSymbol GetSZArrayTypeSymbol(PEModuleSymbol moduleSymbol, TypeSymbol elementType, ImmutableArray<ModifierInfo<TypeSymbol>> customModifiers)
......
...@@ -161,7 +161,7 @@ private void ComputeParameters() ...@@ -161,7 +161,7 @@ private void ComputeParameters()
arglistToken: out arglistToken, arglistToken: out arglistToken,
allowRefOrOut: true, allowRefOrOut: true,
allowThis: true, allowThis: true,
addIsConstModifier: false, addRefReadOnlyModifier: false,
diagnostics: diagnostics); diagnostics: diagnostics);
ParameterHelpers.EnsureIsReadOnlyAttributeExists(parameters, diagnostics, modifyCompilationForRefReadOnly: false); ParameterHelpers.EnsureIsReadOnlyAttributeExists(parameters, diagnostics, modifyCompilationForRefReadOnly: false);
......
...@@ -22,7 +22,7 @@ internal static class ParameterHelpers ...@@ -22,7 +22,7 @@ internal static class ParameterHelpers
DiagnosticBag diagnostics, DiagnosticBag diagnostics,
bool allowRefOrOut, bool allowRefOrOut,
bool allowThis, bool allowThis,
bool addIsConstModifier) bool addRefReadOnlyModifier)
{ {
arglistToken = default(SyntaxToken); arglistToken = default(SyntaxToken);
...@@ -92,7 +92,7 @@ internal static class ParameterHelpers ...@@ -92,7 +92,7 @@ internal static class ParameterHelpers
parameterIndex, parameterIndex,
(paramsKeyword.Kind() != SyntaxKind.None), (paramsKeyword.Kind() != SyntaxKind.None),
parameterIndex == 0 && thisKeyword.Kind() != SyntaxKind.None, parameterIndex == 0 && thisKeyword.Kind() != SyntaxKind.None,
addIsConstModifier, addRefReadOnlyModifier,
diagnostics); diagnostics);
ReportParameterErrors(owner, parameterSyntax, parameter, thisKeyword, paramsKeyword, firstDefault, diagnostics); ReportParameterErrors(owner, parameterSyntax, parameter, thisKeyword, paramsKeyword, firstDefault, diagnostics);
......
...@@ -83,7 +83,7 @@ protected override void MethodChecks(DiagnosticBag diagnostics) ...@@ -83,7 +83,7 @@ protected override void MethodChecks(DiagnosticBag diagnostics)
bodyBinder, this, parameterList, out arglistToken, bodyBinder, this, parameterList, out arglistToken,
allowRefOrOut: true, allowRefOrOut: true,
allowThis: false, allowThis: false,
addIsConstModifier: false, addRefReadOnlyModifier: false,
diagnostics: diagnostics); diagnostics: diagnostics);
_lazyIsVararg = (arglistToken.Kind() == SyntaxKind.ArgListKeyword); _lazyIsVararg = (arglistToken.Kind() == SyntaxKind.ArgListKeyword);
......
...@@ -251,7 +251,7 @@ private sealed class InvokeMethod : SourceDelegateMethodSymbol ...@@ -251,7 +251,7 @@ private sealed class InvokeMethod : SourceDelegateMethodSymbol
binder, this, syntax.ParameterList, out arglistToken, binder, this, syntax.ParameterList, out arglistToken,
allowRefOrOut: true, allowRefOrOut: true,
allowThis: false, allowThis: false,
addIsConstModifier: true, addRefReadOnlyModifier: true,
diagnostics: diagnostics); diagnostics: diagnostics);
if (arglistToken.Kind() == SyntaxKind.ArgListKeyword) if (arglistToken.Kind() == SyntaxKind.ArgListKeyword)
...@@ -264,8 +264,8 @@ private sealed class InvokeMethod : SourceDelegateMethodSymbol ...@@ -264,8 +264,8 @@ private sealed class InvokeMethod : SourceDelegateMethodSymbol
if (_refKind == RefKind.RefReadOnly) if (_refKind == RefKind.RefReadOnly)
{ {
var isConstType = binder.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_IsConst, diagnostics, syntax.ReturnType); var modifierType = binder.GetWellKnownType(WellKnownType.System_Runtime_InteropServices_InAttribute, diagnostics, syntax.ReturnType);
_refCustomModifiers = ImmutableArray.Create(CSharpCustomModifier.CreateRequired(isConstType)); _refCustomModifiers = ImmutableArray.Create(CSharpCustomModifier.CreateRequired(modifierType));
} }
else else
{ {
......
...@@ -168,7 +168,7 @@ private void MethodChecks(MethodDeclarationSyntax syntax, Binder withTypeParamsB ...@@ -168,7 +168,7 @@ private void MethodChecks(MethodDeclarationSyntax syntax, Binder withTypeParamsB
signatureBinder, this, syntax.ParameterList, out arglistToken, signatureBinder, this, syntax.ParameterList, out arglistToken,
allowRefOrOut: true, allowRefOrOut: true,
allowThis: true, allowThis: true,
addIsConstModifier: IsVirtual || IsAbstract, addRefReadOnlyModifier: IsVirtual || IsAbstract,
diagnostics: diagnostics); diagnostics: diagnostics);
_lazyIsVararg = (arglistToken.Kind() == SyntaxKind.ArgListKeyword); _lazyIsVararg = (arglistToken.Kind() == SyntaxKind.ArgListKeyword);
...@@ -338,11 +338,11 @@ private void MethodChecks(MethodDeclarationSyntax syntax, Binder withTypeParamsB ...@@ -338,11 +338,11 @@ private void MethodChecks(MethodDeclarationSyntax syntax, Binder withTypeParamsB
} }
else if (_refKind == RefKind.RefReadOnly) else if (_refKind == RefKind.RefReadOnly)
{ {
var isConstType = withTypeParamsBinder.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_IsConst, diagnostics, syntax.ReturnType); var modifierType = withTypeParamsBinder.GetWellKnownType(WellKnownType.System_Runtime_InteropServices_InAttribute, diagnostics, syntax.ReturnType);
_lazyCustomModifiers = CustomModifiersTuple.Create( _lazyCustomModifiers = CustomModifiersTuple.Create(
typeCustomModifiers: ImmutableArray<CustomModifier>.Empty, typeCustomModifiers: ImmutableArray<CustomModifier>.Empty,
refCustomModifiers: ImmutableArray.Create(CSharpCustomModifier.CreateRequired(isConstType))); refCustomModifiers: ImmutableArray.Create(CSharpCustomModifier.CreateRequired(modifierType)));
} }
} }
else if ((object)_explicitInterfaceType != null) else if ((object)_explicitInterfaceType != null)
......
...@@ -35,7 +35,7 @@ internal abstract class SourceParameterSymbol : SourceParameterSymbolBase ...@@ -35,7 +35,7 @@ internal abstract class SourceParameterSymbol : SourceParameterSymbolBase
int ordinal, int ordinal,
bool isParams, bool isParams,
bool isExtensionMethodThis, bool isExtensionMethodThis,
bool addIsConstModifier, bool addRefReadOnlyModifier,
DiagnosticBag declarationDiagnostics) DiagnosticBag declarationDiagnostics)
{ {
var name = identifier.ValueText; var name = identifier.ValueText;
...@@ -50,9 +50,9 @@ internal abstract class SourceParameterSymbol : SourceParameterSymbolBase ...@@ -50,9 +50,9 @@ internal abstract class SourceParameterSymbol : SourceParameterSymbolBase
identifier.Parent.GetLocation()); identifier.Parent.GetLocation());
} }
if (addIsConstModifier && refKind == RefKind.RefReadOnly) if (addRefReadOnlyModifier && refKind == RefKind.RefReadOnly)
{ {
var isConstType = context.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_IsConst, declarationDiagnostics, syntax); var modifierType = context.GetWellKnownType(WellKnownType.System_Runtime_InteropServices_InAttribute, declarationDiagnostics, syntax);
return new SourceComplexParameterSymbolWithCustomModifiers( return new SourceComplexParameterSymbolWithCustomModifiers(
owner, owner,
...@@ -60,7 +60,7 @@ internal abstract class SourceParameterSymbol : SourceParameterSymbolBase ...@@ -60,7 +60,7 @@ internal abstract class SourceParameterSymbol : SourceParameterSymbolBase
parameterType, parameterType,
refKind, refKind,
ImmutableArray<CustomModifier>.Empty, ImmutableArray<CustomModifier>.Empty,
ImmutableArray.Create(CSharpCustomModifier.CreateRequired(isConstType)), ImmutableArray.Create(CSharpCustomModifier.CreateRequired(modifierType)),
name, name,
locations, locations,
syntax.GetReference(), syntax.GetReference(),
......
...@@ -281,11 +281,11 @@ internal sealed class SourcePropertySymbol : PropertySymbol, IAttributeTargetSym ...@@ -281,11 +281,11 @@ internal sealed class SourcePropertySymbol : PropertySymbol, IAttributeTargetSym
} }
else if (_refKind == RefKind.RefReadOnly) else if (_refKind == RefKind.RefReadOnly)
{ {
var isConstType = bodyBinder.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_IsConst, diagnostics, syntax.Type); var modifierType = bodyBinder.GetWellKnownType(WellKnownType.System_Runtime_InteropServices_InAttribute, diagnostics, syntax.Type);
_customModifiers = CustomModifiersTuple.Create( _customModifiers = CustomModifiersTuple.Create(
ImmutableArray<CustomModifier>.Empty, ImmutableArray<CustomModifier>.Empty,
ImmutableArray.Create(CSharpCustomModifier.CreateRequired(isConstType))); ImmutableArray.Create(CSharpCustomModifier.CreateRequired(modifierType)));
} }
if (!hasAccessorList) if (!hasAccessorList)
...@@ -789,7 +789,7 @@ private DeclarationModifiers MakeModifiers(SyntaxTokenList modifiers, bool isExp ...@@ -789,7 +789,7 @@ private DeclarationModifiers MakeModifiers(SyntaxTokenList modifiers, bool isExp
} }
private static ImmutableArray<ParameterSymbol> MakeParameters( private static ImmutableArray<ParameterSymbol> MakeParameters(
Binder binder, SourcePropertySymbol owner, BaseParameterListSyntax parameterSyntaxOpt, DiagnosticBag diagnostics, bool addIsConstModifier) Binder binder, SourcePropertySymbol owner, BaseParameterListSyntax parameterSyntaxOpt, DiagnosticBag diagnostics, bool addRefReadOnlyModifier)
{ {
if (parameterSyntaxOpt == null) if (parameterSyntaxOpt == null)
{ {
...@@ -806,7 +806,7 @@ private DeclarationModifiers MakeModifiers(SyntaxTokenList modifiers, bool isExp ...@@ -806,7 +806,7 @@ private DeclarationModifiers MakeModifiers(SyntaxTokenList modifiers, bool isExp
binder, owner, parameterSyntaxOpt, out arglistToken, binder, owner, parameterSyntaxOpt, out arglistToken,
allowRefOrOut: false, allowRefOrOut: false,
allowThis: false, allowThis: false,
addIsConstModifier: addIsConstModifier, addRefReadOnlyModifier: addRefReadOnlyModifier,
diagnostics: diagnostics); diagnostics: diagnostics);
if (arglistToken.Kind() != SyntaxKind.None) if (arglistToken.Kind() != SyntaxKind.None)
...@@ -1408,7 +1408,7 @@ private TypeSymbol ComputeType(Binder binder, BasePropertyDeclarationSyntax synt ...@@ -1408,7 +1408,7 @@ private TypeSymbol ComputeType(Binder binder, BasePropertyDeclarationSyntax synt
private ImmutableArray<ParameterSymbol> ComputeParameters(Binder binder, BasePropertyDeclarationSyntax syntax, DiagnosticBag diagnostics) private ImmutableArray<ParameterSymbol> ComputeParameters(Binder binder, BasePropertyDeclarationSyntax syntax, DiagnosticBag diagnostics)
{ {
var parameterSyntaxOpt = GetParameterListSyntax(syntax); var parameterSyntaxOpt = GetParameterListSyntax(syntax);
var parameters = MakeParameters(binder, this, parameterSyntaxOpt, diagnostics, addIsConstModifier: IsVirtual || IsAbstract); var parameters = MakeParameters(binder, this, parameterSyntaxOpt, diagnostics, addRefReadOnlyModifier: IsVirtual || IsAbstract);
HashSet<DiagnosticInfo> useSiteDiagnostics = null; HashSet<DiagnosticInfo> useSiteDiagnostics = null;
foreach (ParameterSymbol param in parameters) foreach (ParameterSymbol param in parameters)
......
...@@ -131,7 +131,7 @@ protected override void MethodChecks(DiagnosticBag diagnostics) ...@@ -131,7 +131,7 @@ protected override void MethodChecks(DiagnosticBag diagnostics)
out arglistToken, out arglistToken,
allowRefOrOut: true, allowRefOrOut: true,
allowThis: false, allowThis: false,
addIsConstModifier: false, addRefReadOnlyModifier: false,
diagnostics: diagnostics); diagnostics: diagnostics);
if (arglistToken.Kind() == SyntaxKind.ArgListKeyword) if (arglistToken.Kind() == SyntaxKind.ArgListKeyword)
......
...@@ -1529,20 +1529,20 @@ private static bool NormalizeTaskTypesInPointer(CSharpCompilation compilation, r ...@@ -1529,20 +1529,20 @@ private static bool NormalizeTaskTypesInPointer(CSharpCompilation compilation, r
return new Cci.TypeReferenceWithAttributes(typeRef); return new Cci.TypeReferenceWithAttributes(typeRef);
} }
internal static bool IsWellKnownTypeIsConst(this ITypeSymbol typeSymbol) internal static bool IsWellKnownTypeInAttribute(this ITypeSymbol typeSymbol)
{ {
if (typeSymbol.Name != "IsConst" || typeSymbol.ContainingType != null) if (typeSymbol.Name != "InAttribute" || typeSymbol.ContainingType != null)
{ {
return false; return false;
} }
var compilerServicesNamespace = typeSymbol.ContainingNamespace; var interopServicesNamespace = typeSymbol.ContainingNamespace;
if (compilerServicesNamespace?.Name != "CompilerServices") if (interopServicesNamespace?.Name != "InteropServices")
{ {
return false; return false;
} }
var runtimeNamespace = compilerServicesNamespace.ContainingNamespace; var runtimeNamespace = interopServicesNamespace.ContainingNamespace;
if (runtimeNamespace?.Name != "Runtime") if (runtimeNamespace?.Name != "Runtime")
{ {
return false; return false;
......
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
<Compile Include="Emit\EntryPointTests.cs" /> <Compile Include="Emit\EntryPointTests.cs" />
<Compile Include="Emit\NoPiaEmbedTypes.cs" /> <Compile Include="Emit\NoPiaEmbedTypes.cs" />
<Compile Include="Emit\OptionalArgumentsTests.cs" /> <Compile Include="Emit\OptionalArgumentsTests.cs" />
<Compile Include="Emit\IsConstModifierTests.cs" /> <Compile Include="Emit\InAttributeModifierTests.cs" />
<Compile Include="Emit\ResourceTests.cs" /> <Compile Include="Emit\ResourceTests.cs" />
<Compile Include="CodeGen\CodeGenScriptTests.cs" /> <Compile Include="CodeGen\CodeGenScriptTests.cs" />
<Compile Include="PDB\CheckSumTest.cs" /> <Compile Include="PDB\CheckSumTest.cs" />
......
...@@ -708,8 +708,8 @@ private TypeSymbol GetTypeOfTypeDef(TypeDefinitionHandle typeDef, out bool isNoP ...@@ -708,8 +708,8 @@ private TypeSymbol GetTypeOfTypeDef(TypeDefinitionHandle typeDef, out bool isNoP
switch (allowedRequiredModifierType) switch (allowedRequiredModifierType)
{ {
case AllowedRequiredModifierType.System_Runtime_CompilerServices_IsConst: case AllowedRequiredModifierType.System_Runtime_InteropServices_InAttribute:
isAllowed = IsAcceptedIsConstModifierType(type); isAllowed = IsAcceptedInAttributeModifierType(type);
break; break;
case AllowedRequiredModifierType.System_Runtime_CompilerServices_Volatile: case AllowedRequiredModifierType.System_Runtime_CompilerServices_Volatile:
isAllowed = IsAcceptedVolatileModifierType(type); isAllowed = IsAcceptedVolatileModifierType(type);
...@@ -1130,9 +1130,9 @@ private void DecodeParameterOrThrow(ref BlobReader signatureReader, /*out*/ ref ...@@ -1130,9 +1130,9 @@ private void DecodeParameterOrThrow(ref BlobReader signatureReader, /*out*/ ref
{ {
info.CustomModifiers = DecodeModifiersOrThrow( info.CustomModifiers = DecodeModifiersOrThrow(
ref signatureReader, ref signatureReader,
AllowedRequiredModifierType.System_Runtime_CompilerServices_IsConst, AllowedRequiredModifierType.System_Runtime_InteropServices_InAttribute,
out SignatureTypeCode typeCode, out SignatureTypeCode typeCode,
out bool isConstFound); out bool inAttributeFound);
if (typeCode == SignatureTypeCode.ByReference) if (typeCode == SignatureTypeCode.ByReference)
{ {
...@@ -1140,7 +1140,7 @@ private void DecodeParameterOrThrow(ref BlobReader signatureReader, /*out*/ ref ...@@ -1140,7 +1140,7 @@ private void DecodeParameterOrThrow(ref BlobReader signatureReader, /*out*/ ref
info.RefCustomModifiers = info.CustomModifiers; info.RefCustomModifiers = info.CustomModifiers;
info.CustomModifiers = DecodeModifiersOrThrow(ref signatureReader, AllowedRequiredModifierType.None, out typeCode, out _); info.CustomModifiers = DecodeModifiersOrThrow(ref signatureReader, AllowedRequiredModifierType.None, out typeCode, out _);
} }
else if (isConstFound) else if (inAttributeFound)
{ {
// This cannot be placed on CustomModifiers, just RefCustomModifiers // This cannot be placed on CustomModifiers, just RefCustomModifiers
throw new UnsupportedSignatureContent(); throw new UnsupportedSignatureContent();
...@@ -2412,7 +2412,7 @@ private enum AllowedRequiredModifierType ...@@ -2412,7 +2412,7 @@ private enum AllowedRequiredModifierType
{ {
None, None,
System_Runtime_CompilerServices_Volatile, System_Runtime_CompilerServices_Volatile,
System_Runtime_CompilerServices_IsConst, System_Runtime_InteropServices_InAttribute,
} }
} }
} }
...@@ -41,7 +41,7 @@ internal abstract class SymbolFactory<ModuleSymbol, TypeSymbol> ...@@ -41,7 +41,7 @@ internal abstract class SymbolFactory<ModuleSymbol, TypeSymbol>
internal abstract TypeSymbol GetEnumUnderlyingType(ModuleSymbol moduleSymbol, TypeSymbol type); internal abstract TypeSymbol GetEnumUnderlyingType(ModuleSymbol moduleSymbol, TypeSymbol type);
internal abstract bool IsAcceptedVolatileModifierType(ModuleSymbol moduleSymbol, TypeSymbol type); internal abstract bool IsAcceptedVolatileModifierType(ModuleSymbol moduleSymbol, TypeSymbol type);
internal abstract bool IsAcceptedIsConstModifierType(TypeSymbol type); internal abstract bool IsAcceptedInAttributeModifierType(TypeSymbol type);
internal abstract Cci.PrimitiveTypeCode GetPrimitiveTypeCode(ModuleSymbol moduleSymbol, TypeSymbol type); internal abstract Cci.PrimitiveTypeCode GetPrimitiveTypeCode(ModuleSymbol moduleSymbol, TypeSymbol type);
} }
} }
...@@ -93,9 +93,9 @@ protected bool IsAcceptedVolatileModifierType(TypeSymbol type) ...@@ -93,9 +93,9 @@ protected bool IsAcceptedVolatileModifierType(TypeSymbol type)
return _factory.IsAcceptedVolatileModifierType(this.moduleSymbol, type); return _factory.IsAcceptedVolatileModifierType(this.moduleSymbol, type);
} }
protected bool IsAcceptedIsConstModifierType(TypeSymbol type) protected bool IsAcceptedInAttributeModifierType(TypeSymbol type)
{ {
return _factory.IsAcceptedIsConstModifierType(type); return _factory.IsAcceptedInAttributeModifierType(type);
} }
protected Microsoft.Cci.PrimitiveTypeCode GetPrimitiveTypeCode(TypeSymbol type) protected Microsoft.Cci.PrimitiveTypeCode GetPrimitiveTypeCode(TypeSymbol type)
......
...@@ -267,7 +267,7 @@ internal enum WellKnownType ...@@ -267,7 +267,7 @@ internal enum WellKnownType
System_Runtime_CompilerServices_IsReadOnlyAttribute, System_Runtime_CompilerServices_IsReadOnlyAttribute,
System_Runtime_CompilerServices_IsByRefLikeAttribute, System_Runtime_CompilerServices_IsByRefLikeAttribute,
System_Runtime_CompilerServices_IsConst, System_Runtime_InteropServices_InAttribute,
System_ObsoleteAttribute, System_ObsoleteAttribute,
NextAvailable, NextAvailable,
...@@ -531,7 +531,7 @@ internal static class WellKnownTypes ...@@ -531,7 +531,7 @@ internal static class WellKnownTypes
"System.Runtime.CompilerServices.IsReadOnlyAttribute", "System.Runtime.CompilerServices.IsReadOnlyAttribute",
"System.Runtime.CompilerServices.IsByRefLikeAttribute", "System.Runtime.CompilerServices.IsByRefLikeAttribute",
"System.Runtime.CompilerServices.IsConst", "System.Runtime.InteropServices.InAttribute",
"System.ObsoleteAttribute", "System.ObsoleteAttribute",
}; };
......
...@@ -49,7 +49,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols.Metadata.PE ...@@ -49,7 +49,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols.Metadata.PE
Return False Return False
End Function End Function
Friend Overrides Function IsAcceptedIsConstModifierType(type As TypeSymbol) As Boolean Friend Overrides Function IsAcceptedInAttributeModifierType(type As TypeSymbol) As Boolean
' VB doesn't deal with ref-readonly parameters or return-types. ' VB doesn't deal with ref-readonly parameters or return-types.
Return False Return False
End Function End Function
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<Compile Include="SymbolsTests\AnonymousTypes\AnonymousTypesEmittedSymbolsTests.vb" /> <Compile Include="SymbolsTests\AnonymousTypes\AnonymousTypesEmittedSymbolsTests.vb" />
<Compile Include="SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb" /> <Compile Include="SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb" />
<Compile Include="SymbolsTests\CustomModifiersTests.vb" /> <Compile Include="SymbolsTests\CustomModifiersTests.vb" />
<Compile Include="SymbolsTests\Metadata\PE\IsConstModifierTests.vb" /> <Compile Include="SymbolsTests\Metadata\PE\InAttributeModifierTests.vb" />
<Compile Include="SymbolsTests\WellKnownTypeValidationTests.vb" /> <Compile Include="SymbolsTests\WellKnownTypeValidationTests.vb" />
<Compile Include="SymbolsTests\AssemblyAndNamespaceTests.vb" /> <Compile Include="SymbolsTests\AssemblyAndNamespaceTests.vb" />
<Compile Include="SymbolsTests\CompilationCreationTests.vb" /> <Compile Include="SymbolsTests\CompilationCreationTests.vb" />
......
...@@ -5,7 +5,7 @@ Imports Microsoft.CodeAnalysis.Test.Utilities ...@@ -5,7 +5,7 @@ Imports Microsoft.CodeAnalysis.Test.Utilities
Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.Symbols.Metadata Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.Symbols.Metadata
Public Class IsConstModifierTests Public Class InAttributeModifierTests
Inherits BasicTestBase Inherits BasicTestBase
<Fact> <Fact>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册