Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
6a688b0f
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6a688b0f
编写于
6月 15, 2017
作者:
O
Omar Tawfik
提交者:
vsadov
6月 23, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace IsConst modreq with InAttribute
Fixes #19950
上级
2401959c
变更
21
展开全部
显示空白变更内容
内联
并排
Showing
21 changed file
with
290 addition
and
290 deletion
+290
-290
src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEParameterSymbol.cs
.../CSharp/Portable/Symbols/Metadata/PE/PEParameterSymbol.cs
+2
-2
src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEPropertySymbol.cs
...s/CSharp/Portable/Symbols/Metadata/PE/PEPropertySymbol.cs
+2
-2
src/Compilers/CSharp/Portable/Symbols/Metadata/PE/SymbolFactory.cs
...lers/CSharp/Portable/Symbols/Metadata/PE/SymbolFactory.cs
+2
-2
src/Compilers/CSharp/Portable/Symbols/Source/LocalFunctionSymbol.cs
...ers/CSharp/Portable/Symbols/Source/LocalFunctionSymbol.cs
+1
-1
src/Compilers/CSharp/Portable/Symbols/Source/ParameterHelpers.cs
...pilers/CSharp/Portable/Symbols/Source/ParameterHelpers.cs
+2
-2
src/Compilers/CSharp/Portable/Symbols/Source/SourceConstructorSymbol.cs
...CSharp/Portable/Symbols/Source/SourceConstructorSymbol.cs
+1
-1
src/Compilers/CSharp/Portable/Symbols/Source/SourceDelegateMethodSymbol.cs
...arp/Portable/Symbols/Source/SourceDelegateMethodSymbol.cs
+3
-3
src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberMethodSymbol.cs
...Sharp/Portable/Symbols/Source/SourceMemberMethodSymbol.cs
+3
-3
src/Compilers/CSharp/Portable/Symbols/Source/SourceParameterSymbol.cs
...s/CSharp/Portable/Symbols/Source/SourceParameterSymbol.cs
+4
-4
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertySymbol.cs
...rs/CSharp/Portable/Symbols/Source/SourcePropertySymbol.cs
+5
-5
src/Compilers/CSharp/Portable/Symbols/Source/SourceUserDefinedOperatorSymbolBase.cs
...ble/Symbols/Source/SourceUserDefinedOperatorSymbolBase.cs
+1
-1
src/Compilers/CSharp/Portable/Symbols/TypeSymbolExtensions.cs
...Compilers/CSharp/Portable/Symbols/TypeSymbolExtensions.cs
+5
-5
src/Compilers/CSharp/Test/Emit/CSharpCompilerEmitTest.csproj
src/Compilers/CSharp/Test/Emit/CSharpCompilerEmitTest.csproj
+1
-1
src/Compilers/CSharp/Test/Emit/Emit/InAttributeModifierTests.cs
...mpilers/CSharp/Test/Emit/Emit/InAttributeModifierTests.cs
+244
-244
src/Compilers/Core/Portable/MetadataReader/MetadataDecoder.cs
...Compilers/Core/Portable/MetadataReader/MetadataDecoder.cs
+6
-6
src/Compilers/Core/Portable/MetadataReader/SymbolFactory.cs
src/Compilers/Core/Portable/MetadataReader/SymbolFactory.cs
+1
-1
src/Compilers/Core/Portable/MetadataReader/TypeNameDecoder.cs
...Compilers/Core/Portable/MetadataReader/TypeNameDecoder.cs
+2
-2
src/Compilers/Core/Portable/WellKnownTypes.cs
src/Compilers/Core/Portable/WellKnownTypes.cs
+2
-2
src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/SymbolFactory.vb
...VisualBasic/Portable/Symbols/Metadata/PE/SymbolFactory.vb
+1
-1
src/Compilers/VisualBasic/Test/Symbol/BasicCompilerSymbolTest.vbproj
...rs/VisualBasic/Test/Symbol/BasicCompilerSymbolTest.vbproj
+1
-1
src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/Metadata/PE/InAttributeModifierTests.vb
...mbol/SymbolsTests/Metadata/PE/InAttributeModifierTests.vb
+1
-1
未找到文件。
src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEParameterSymbol.cs
浏览文件 @
6a688b0f
...
...
@@ -304,9 +304,9 @@ private sealed class PEParameterSymbolWithCustomModifiers : PEParameterSymbol
_customModifiers
=
CSharpCustomModifier
.
Convert
(
customModifiers
);
_refCustomModifiers
=
CSharpCustomModifier
.
Convert
(
refCustomModifiers
);
if
(
this
.
RefKind
!=
RefKind
.
RefReadOnly
&&
_refCustomModifiers
.
Any
(
modifier
=>
!
modifier
.
IsOptional
&&
modifier
.
Modifier
.
IsWellKnownTypeI
sConst
()))
if
(
this
.
RefKind
!=
RefKind
.
RefReadOnly
&&
_refCustomModifiers
.
Any
(
modifier
=>
!
modifier
.
IsOptional
&&
modifier
.
Modifier
.
IsWellKnownTypeI
nAttribute
()))
{
//
IsConst
modreq is only accepted on RefReadOnly symbols
//
The
modreq is only accepted on RefReadOnly symbols
isBad
=
true
;
}
...
...
src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEPropertySymbol.cs
浏览文件 @
6a688b0f
...
...
@@ -742,8 +742,8 @@ private sealed class PEPropertySymbolWithCustomModifiers : PEPropertySymbol
_typeCustomModifiers
=
CSharpCustomModifier
.
Convert
(
returnInfo
.
CustomModifiers
);
_refCustomModifiers
=
CSharpCustomModifier
.
Convert
(
returnInfo
.
RefCustomModifiers
);
//
IsConst
modreq is only accepted on RefReadOnly symbols
isBad
=
this
.
RefKind
!=
RefKind
.
RefReadOnly
&&
_refCustomModifiers
.
Any
(
modifier
=>
!
modifier
.
IsOptional
&&
modifier
.
Modifier
.
IsWellKnownTypeI
sConst
());
//
The
modreq is only accepted on RefReadOnly symbols
isBad
=
this
.
RefKind
!=
RefKind
.
RefReadOnly
&&
_refCustomModifiers
.
Any
(
modifier
=>
!
modifier
.
IsOptional
&&
modifier
.
Modifier
.
IsWellKnownTypeI
nAttribute
());
}
public
override
ImmutableArray
<
CustomModifier
>
TypeCustomModifiers
...
...
src/Compilers/CSharp/Portable/Symbols/Metadata/PE/SymbolFactory.cs
浏览文件 @
6a688b0f
...
...
@@ -57,9 +57,9 @@ internal override bool IsAcceptedVolatileModifierType(PEModuleSymbol moduleSymbo
return
type
.
SpecialType
==
SpecialType
.
System_Runtime_CompilerServices_IsVolatile
;
}
internal
override
bool
IsAcceptedI
sConst
ModifierType
(
TypeSymbol
type
)
internal
override
bool
IsAcceptedI
nAttribute
ModifierType
(
TypeSymbol
type
)
{
return
type
.
IsWellKnownTypeI
sConst
();
return
type
.
IsWellKnownTypeI
nAttribute
();
}
internal
override
TypeSymbol
GetSZArrayTypeSymbol
(
PEModuleSymbol
moduleSymbol
,
TypeSymbol
elementType
,
ImmutableArray
<
ModifierInfo
<
TypeSymbol
>>
customModifiers
)
...
...
src/Compilers/CSharp/Portable/Symbols/Source/LocalFunctionSymbol.cs
浏览文件 @
6a688b0f
...
...
@@ -161,7 +161,7 @@ private void ComputeParameters()
arglistToken
:
out
arglistToken
,
allowRefOrOut
:
true
,
allowThis
:
true
,
add
IsConst
Modifier
:
false
,
add
RefReadOnly
Modifier
:
false
,
diagnostics
:
diagnostics
);
ParameterHelpers
.
EnsureIsReadOnlyAttributeExists
(
parameters
,
diagnostics
,
modifyCompilationForRefReadOnly
:
false
);
...
...
src/Compilers/CSharp/Portable/Symbols/Source/ParameterHelpers.cs
浏览文件 @
6a688b0f
...
...
@@ -22,7 +22,7 @@ internal static class ParameterHelpers
DiagnosticBag
diagnostics
,
bool
allowRefOrOut
,
bool
allowThis
,
bool
add
IsConst
Modifier
)
bool
add
RefReadOnly
Modifier
)
{
arglistToken
=
default
(
SyntaxToken
);
...
...
@@ -92,7 +92,7 @@ internal static class ParameterHelpers
parameterIndex
,
(
paramsKeyword
.
Kind
()
!=
SyntaxKind
.
None
),
parameterIndex
==
0
&&
thisKeyword
.
Kind
()
!=
SyntaxKind
.
None
,
add
IsConst
Modifier
,
add
RefReadOnly
Modifier
,
diagnostics
);
ReportParameterErrors
(
owner
,
parameterSyntax
,
parameter
,
thisKeyword
,
paramsKeyword
,
firstDefault
,
diagnostics
);
...
...
src/Compilers/CSharp/Portable/Symbols/Source/SourceConstructorSymbol.cs
浏览文件 @
6a688b0f
...
...
@@ -83,7 +83,7 @@ protected override void MethodChecks(DiagnosticBag diagnostics)
bodyBinder
,
this
,
parameterList
,
out
arglistToken
,
allowRefOrOut
:
true
,
allowThis
:
false
,
add
IsConst
Modifier
:
false
,
add
RefReadOnly
Modifier
:
false
,
diagnostics
:
diagnostics
);
_lazyIsVararg
=
(
arglistToken
.
Kind
()
==
SyntaxKind
.
ArgListKeyword
);
...
...
src/Compilers/CSharp/Portable/Symbols/Source/SourceDelegateMethodSymbol.cs
浏览文件 @
6a688b0f
...
...
@@ -251,7 +251,7 @@ private sealed class InvokeMethod : SourceDelegateMethodSymbol
binder
,
this
,
syntax
.
ParameterList
,
out
arglistToken
,
allowRefOrOut
:
true
,
allowThis
:
false
,
add
IsConst
Modifier
:
true
,
add
RefReadOnly
Modifier
:
true
,
diagnostics
:
diagnostics
);
if
(
arglistToken
.
Kind
()
==
SyntaxKind
.
ArgListKeyword
)
...
...
@@ -264,8 +264,8 @@ private sealed class InvokeMethod : SourceDelegateMethodSymbol
if
(
_refKind
==
RefKind
.
RefReadOnly
)
{
var
isConstType
=
binder
.
GetWellKnownType
(
WellKnownType
.
System_Runtime_CompilerServices_IsConst
,
diagnostics
,
syntax
.
ReturnType
);
_refCustomModifiers
=
ImmutableArray
.
Create
(
CSharpCustomModifier
.
CreateRequired
(
isConst
Type
));
var
modifierType
=
binder
.
GetWellKnownType
(
WellKnownType
.
System_Runtime_InteropServices_InAttribute
,
diagnostics
,
syntax
.
ReturnType
);
_refCustomModifiers
=
ImmutableArray
.
Create
(
CSharpCustomModifier
.
CreateRequired
(
modifier
Type
));
}
else
{
...
...
src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberMethodSymbol.cs
浏览文件 @
6a688b0f
...
...
@@ -168,7 +168,7 @@ private void MethodChecks(MethodDeclarationSyntax syntax, Binder withTypeParamsB
signatureBinder
,
this
,
syntax
.
ParameterList
,
out
arglistToken
,
allowRefOrOut
:
true
,
allowThis
:
true
,
add
IsConst
Modifier
:
IsVirtual
||
IsAbstract
,
add
RefReadOnly
Modifier
:
IsVirtual
||
IsAbstract
,
diagnostics
:
diagnostics
);
_lazyIsVararg
=
(
arglistToken
.
Kind
()
==
SyntaxKind
.
ArgListKeyword
);
...
...
@@ -338,11 +338,11 @@ private void MethodChecks(MethodDeclarationSyntax syntax, Binder withTypeParamsB
}
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
(
typeCustomModifiers
:
ImmutableArray
<
CustomModifier
>.
Empty
,
refCustomModifiers
:
ImmutableArray
.
Create
(
CSharpCustomModifier
.
CreateRequired
(
isConst
Type
)));
refCustomModifiers
:
ImmutableArray
.
Create
(
CSharpCustomModifier
.
CreateRequired
(
modifier
Type
)));
}
}
else
if
((
object
)
_explicitInterfaceType
!=
null
)
...
...
src/Compilers/CSharp/Portable/Symbols/Source/SourceParameterSymbol.cs
浏览文件 @
6a688b0f
...
...
@@ -35,7 +35,7 @@ internal abstract class SourceParameterSymbol : SourceParameterSymbolBase
int
ordinal
,
bool
isParams
,
bool
isExtensionMethodThis
,
bool
add
IsConst
Modifier
,
bool
add
RefReadOnly
Modifier
,
DiagnosticBag
declarationDiagnostics
)
{
var
name
=
identifier
.
ValueText
;
...
...
@@ -50,9 +50,9 @@ internal abstract class SourceParameterSymbol : SourceParameterSymbolBase
identifier
.
Parent
.
GetLocation
());
}
if
(
add
IsConst
Modifier
&&
refKind
==
RefKind
.
RefReadOnly
)
if
(
add
RefReadOnly
Modifier
&&
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
(
owner
,
...
...
@@ -60,7 +60,7 @@ internal abstract class SourceParameterSymbol : SourceParameterSymbolBase
parameterType
,
refKind
,
ImmutableArray
<
CustomModifier
>.
Empty
,
ImmutableArray
.
Create
(
CSharpCustomModifier
.
CreateRequired
(
isConst
Type
)),
ImmutableArray
.
Create
(
CSharpCustomModifier
.
CreateRequired
(
modifier
Type
)),
name
,
locations
,
syntax
.
GetReference
(),
...
...
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertySymbol.cs
浏览文件 @
6a688b0f
...
...
@@ -281,11 +281,11 @@ internal sealed class SourcePropertySymbol : PropertySymbol, IAttributeTargetSym
}
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
(
ImmutableArray
<
CustomModifier
>.
Empty
,
ImmutableArray
.
Create
(
CSharpCustomModifier
.
CreateRequired
(
isConst
Type
)));
ImmutableArray
.
Create
(
CSharpCustomModifier
.
CreateRequired
(
modifier
Type
)));
}
if
(!
hasAccessorList
)
...
...
@@ -789,7 +789,7 @@ private DeclarationModifiers MakeModifiers(SyntaxTokenList modifiers, bool isExp
}
private
static
ImmutableArray
<
ParameterSymbol
>
MakeParameters
(
Binder
binder
,
SourcePropertySymbol
owner
,
BaseParameterListSyntax
parameterSyntaxOpt
,
DiagnosticBag
diagnostics
,
bool
add
IsConst
Modifier
)
Binder
binder
,
SourcePropertySymbol
owner
,
BaseParameterListSyntax
parameterSyntaxOpt
,
DiagnosticBag
diagnostics
,
bool
add
RefReadOnly
Modifier
)
{
if
(
parameterSyntaxOpt
==
null
)
{
...
...
@@ -806,7 +806,7 @@ private DeclarationModifiers MakeModifiers(SyntaxTokenList modifiers, bool isExp
binder
,
owner
,
parameterSyntaxOpt
,
out
arglistToken
,
allowRefOrOut
:
false
,
allowThis
:
false
,
add
IsConstModifier
:
addIsConst
Modifier
,
add
RefReadOnlyModifier
:
addRefReadOnly
Modifier
,
diagnostics
:
diagnostics
);
if
(
arglistToken
.
Kind
()
!=
SyntaxKind
.
None
)
...
...
@@ -1408,7 +1408,7 @@ private TypeSymbol ComputeType(Binder binder, BasePropertyDeclarationSyntax synt
private
ImmutableArray
<
ParameterSymbol
>
ComputeParameters
(
Binder
binder
,
BasePropertyDeclarationSyntax
syntax
,
DiagnosticBag
diagnostics
)
{
var
parameterSyntaxOpt
=
GetParameterListSyntax
(
syntax
);
var
parameters
=
MakeParameters
(
binder
,
this
,
parameterSyntaxOpt
,
diagnostics
,
add
IsConst
Modifier
:
IsVirtual
||
IsAbstract
);
var
parameters
=
MakeParameters
(
binder
,
this
,
parameterSyntaxOpt
,
diagnostics
,
add
RefReadOnly
Modifier
:
IsVirtual
||
IsAbstract
);
HashSet
<
DiagnosticInfo
>
useSiteDiagnostics
=
null
;
foreach
(
ParameterSymbol
param
in
parameters
)
...
...
src/Compilers/CSharp/Portable/Symbols/Source/SourceUserDefinedOperatorSymbolBase.cs
浏览文件 @
6a688b0f
...
...
@@ -131,7 +131,7 @@ protected override void MethodChecks(DiagnosticBag diagnostics)
out
arglistToken
,
allowRefOrOut
:
true
,
allowThis
:
false
,
add
IsConst
Modifier
:
false
,
add
RefReadOnly
Modifier
:
false
,
diagnostics
:
diagnostics
);
if
(
arglistToken
.
Kind
()
==
SyntaxKind
.
ArgListKeyword
)
...
...
src/Compilers/CSharp/Portable/Symbols/TypeSymbolExtensions.cs
浏览文件 @
6a688b0f
...
...
@@ -1529,20 +1529,20 @@ private static bool NormalizeTaskTypesInPointer(CSharpCompilation compilation, r
return
new
Cci
.
TypeReferenceWithAttributes
(
typeRef
);
}
internal
static
bool
IsWellKnownTypeI
sConst
(
this
ITypeSymbol
typeSymbol
)
internal
static
bool
IsWellKnownTypeI
nAttribute
(
this
ITypeSymbol
typeSymbol
)
{
if
(
typeSymbol
.
Name
!=
"I
sConst
"
||
typeSymbol
.
ContainingType
!=
null
)
if
(
typeSymbol
.
Name
!=
"I
nAttribute
"
||
typeSymbol
.
ContainingType
!=
null
)
{
return
false
;
}
var
compiler
ServicesNamespace
=
typeSymbol
.
ContainingNamespace
;
if
(
compilerServicesNamespace
?.
Name
!=
"Compiler
Services"
)
var
interop
ServicesNamespace
=
typeSymbol
.
ContainingNamespace
;
if
(
interopServicesNamespace
?.
Name
!=
"Interop
Services"
)
{
return
false
;
}
var
runtimeNamespace
=
compiler
ServicesNamespace
.
ContainingNamespace
;
var
runtimeNamespace
=
interop
ServicesNamespace
.
ContainingNamespace
;
if
(
runtimeNamespace
?.
Name
!=
"Runtime"
)
{
return
false
;
...
...
src/Compilers/CSharp/Test/Emit/CSharpCompilerEmitTest.csproj
浏览文件 @
6a688b0f
...
...
@@ -161,7 +161,7 @@
<Compile
Include=
"Emit\EntryPointTests.cs"
/>
<Compile
Include=
"Emit\NoPiaEmbedTypes.cs"
/>
<Compile
Include=
"Emit\OptionalArgumentsTests.cs"
/>
<Compile
Include=
"Emit\I
sConst
ModifierTests.cs"
/>
<Compile
Include=
"Emit\I
nAttribute
ModifierTests.cs"
/>
<Compile
Include=
"Emit\ResourceTests.cs"
/>
<Compile
Include=
"CodeGen\CodeGenScriptTests.cs"
/>
<Compile
Include=
"PDB\CheckSumTest.cs"
/>
...
...
src/Compilers/CSharp/Test/Emit/Emit/I
sConst
ModifierTests.cs
→
src/Compilers/CSharp/Test/Emit/Emit/I
nAttribute
ModifierTests.cs
浏览文件 @
6a688b0f
此差异已折叠。
点击以展开。
src/Compilers/Core/Portable/MetadataReader/MetadataDecoder.cs
浏览文件 @
6a688b0f
...
...
@@ -708,8 +708,8 @@ private TypeSymbol GetTypeOfTypeDef(TypeDefinitionHandle typeDef, out bool isNoP
switch
(
allowedRequiredModifierType
)
{
case
AllowedRequiredModifierType
.
System_Runtime_
CompilerServices_IsConst
:
isAllowed
=
IsAcceptedI
sConst
ModifierType
(
type
);
case
AllowedRequiredModifierType
.
System_Runtime_
InteropServices_InAttribute
:
isAllowed
=
IsAcceptedI
nAttribute
ModifierType
(
type
);
break
;
case
AllowedRequiredModifierType
.
System_Runtime_CompilerServices_Volatile
:
isAllowed
=
IsAcceptedVolatileModifierType
(
type
);
...
...
@@ -1130,9 +1130,9 @@ private void DecodeParameterOrThrow(ref BlobReader signatureReader, /*out*/ ref
{
info
.
CustomModifiers
=
DecodeModifiersOrThrow
(
ref
signatureReader
,
AllowedRequiredModifierType
.
System_Runtime_
CompilerServices_IsConst
,
AllowedRequiredModifierType
.
System_Runtime_
InteropServices_InAttribute
,
out
SignatureTypeCode
typeCode
,
out
bool
i
sConst
Found
);
out
bool
i
nAttribute
Found
);
if
(
typeCode
==
SignatureTypeCode
.
ByReference
)
{
...
...
@@ -1140,7 +1140,7 @@ private void DecodeParameterOrThrow(ref BlobReader signatureReader, /*out*/ ref
info
.
RefCustomModifiers
=
info
.
CustomModifiers
;
info
.
CustomModifiers
=
DecodeModifiersOrThrow
(
ref
signatureReader
,
AllowedRequiredModifierType
.
None
,
out
typeCode
,
out
_
);
}
else
if
(
i
sConst
Found
)
else
if
(
i
nAttribute
Found
)
{
// This cannot be placed on CustomModifiers, just RefCustomModifiers
throw
new
UnsupportedSignatureContent
();
...
...
@@ -2412,7 +2412,7 @@ private enum AllowedRequiredModifierType
{
None
,
System_Runtime_CompilerServices_Volatile
,
System_Runtime_
CompilerServices_IsConst
,
System_Runtime_
InteropServices_InAttribute
,
}
}
}
src/Compilers/Core/Portable/MetadataReader/SymbolFactory.cs
浏览文件 @
6a688b0f
...
...
@@ -41,7 +41,7 @@ internal abstract class SymbolFactory<ModuleSymbol, TypeSymbol>
internal
abstract
TypeSymbol
GetEnumUnderlyingType
(
ModuleSymbol
moduleSymbol
,
TypeSymbol
type
);
internal
abstract
bool
IsAcceptedVolatileModifierType
(
ModuleSymbol
moduleSymbol
,
TypeSymbol
type
);
internal
abstract
bool
IsAcceptedI
sConst
ModifierType
(
TypeSymbol
type
);
internal
abstract
bool
IsAcceptedI
nAttribute
ModifierType
(
TypeSymbol
type
);
internal
abstract
Cci
.
PrimitiveTypeCode
GetPrimitiveTypeCode
(
ModuleSymbol
moduleSymbol
,
TypeSymbol
type
);
}
}
src/Compilers/Core/Portable/MetadataReader/TypeNameDecoder.cs
浏览文件 @
6a688b0f
...
...
@@ -93,9 +93,9 @@ protected bool IsAcceptedVolatileModifierType(TypeSymbol type)
return
_factory
.
IsAcceptedVolatileModifierType
(
this
.
moduleSymbol
,
type
);
}
protected
bool
IsAcceptedI
sConst
ModifierType
(
TypeSymbol
type
)
protected
bool
IsAcceptedI
nAttribute
ModifierType
(
TypeSymbol
type
)
{
return
_factory
.
IsAcceptedI
sConst
ModifierType
(
type
);
return
_factory
.
IsAcceptedI
nAttribute
ModifierType
(
type
);
}
protected
Microsoft
.
Cci
.
PrimitiveTypeCode
GetPrimitiveTypeCode
(
TypeSymbol
type
)
...
...
src/Compilers/Core/Portable/WellKnownTypes.cs
浏览文件 @
6a688b0f
...
...
@@ -267,7 +267,7 @@ internal enum WellKnownType
System_Runtime_CompilerServices_IsReadOnlyAttribute
,
System_Runtime_CompilerServices_IsByRefLikeAttribute
,
System_Runtime_
CompilerServices_IsConst
,
System_Runtime_
InteropServices_InAttribute
,
System_ObsoleteAttribute
,
NextAvailable
,
...
...
@@ -531,7 +531,7 @@ internal static class WellKnownTypes
"System.Runtime.CompilerServices.IsReadOnlyAttribute"
,
"System.Runtime.CompilerServices.IsByRefLikeAttribute"
,
"System.Runtime.
CompilerServices.IsConst
"
,
"System.Runtime.
InteropServices.InAttribute
"
,
"System.ObsoleteAttribute"
,
};
...
...
src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/SymbolFactory.vb
浏览文件 @
6a688b0f
...
...
@@ -49,7 +49,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols.Metadata.PE
Return
False
End
Function
Friend
Overrides
Function
IsAcceptedI
sConst
ModifierType
(
type
As
TypeSymbol
)
As
Boolean
Friend
Overrides
Function
IsAcceptedI
nAttribute
ModifierType
(
type
As
TypeSymbol
)
As
Boolean
' VB doesn't deal with ref-readonly parameters or return-types.
Return
False
End
Function
...
...
src/Compilers/VisualBasic/Test/Symbol/BasicCompilerSymbolTest.vbproj
浏览文件 @
6a688b0f
...
...
@@ -89,7 +89,7 @@
<Compile
Include=
"SymbolsTests\AnonymousTypes\AnonymousTypesEmittedSymbolsTests.vb"
/>
<Compile
Include=
"SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb"
/>
<Compile
Include=
"SymbolsTests\CustomModifiersTests.vb"
/>
<Compile
Include=
"SymbolsTests\Metadata\PE\I
sConst
ModifierTests.vb"
/>
<Compile
Include=
"SymbolsTests\Metadata\PE\I
nAttribute
ModifierTests.vb"
/>
<Compile
Include=
"SymbolsTests\WellKnownTypeValidationTests.vb"
/>
<Compile
Include=
"SymbolsTests\AssemblyAndNamespaceTests.vb"
/>
<Compile
Include=
"SymbolsTests\CompilationCreationTests.vb"
/>
...
...
src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/Metadata/PE/I
sConst
ModifierTests.vb
→
src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/Metadata/PE/I
nAttribute
ModifierTests.vb
浏览文件 @
6a688b0f
...
...
@@ -5,7 +5,7 @@ Imports Microsoft.CodeAnalysis.Test.Utilities
Namespace
Microsoft.CodeAnalysis.VisualBasic.UnitTests.Symbols.Metadata
Public
Class
I
sConst
ModifierTests
Public
Class
I
nAttribute
ModifierTests
Inherits
BasicTestBase
<
Fact
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录