Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
5b097cf6
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,发现更多精彩内容 >>
未验证
提交
5b097cf6
编写于
5月 06, 2019
作者:
A
AlekseyTs
提交者:
GitHub
5月 06, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change accessibility of explicit implementations in interfaces to 'private'. (#35506)
上级
472276ac
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
11 addition
and
11 deletion
+11
-11
src/Compilers/CSharp/Portable/Symbols/Source/ModifierUtils.cs
...Compilers/CSharp/Portable/Symbols/Source/ModifierUtils.cs
+2
-2
src/Compilers/CSharp/Portable/Symbols/Source/SourceEventSymbol.cs
...ilers/CSharp/Portable/Symbols/Source/SourceEventSymbol.cs
+1
-1
src/Compilers/CSharp/Portable/Symbols/Source/SourceOrdinaryMethodSymbol.cs
...arp/Portable/Symbols/Source/SourceOrdinaryMethodSymbol.cs
+1
-1
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertySymbol.cs
...rs/CSharp/Portable/Symbols/Source/SourcePropertySymbol.cs
+1
-1
src/Compilers/CSharp/Test/Symbol/Symbols/DefaultInterfaceImplementationTests.cs
...est/Symbol/Symbols/DefaultInterfaceImplementationTests.cs
+6
-6
未找到文件。
src/Compilers/CSharp/Portable/Symbols/Source/ModifierUtils.cs
浏览文件 @
5b097cf6
...
...
@@ -144,9 +144,9 @@ internal static DeclarationModifiers AdjustModifiersForAnInterfaceMember(Declara
if
((
mods
&
DeclarationModifiers
.
AccessibilityMask
)
==
0
)
{
if
((
mods
&
DeclarationModifiers
.
Partial
)
==
0
)
if
((
mods
&
DeclarationModifiers
.
Partial
)
==
0
&&
!
isExplicitInterfaceImplementation
)
{
mods
|=
isExplicitInterfaceImplementation
?
DeclarationModifiers
.
Protected
:
DeclarationModifiers
.
Public
;
mods
|=
DeclarationModifiers
.
Public
;
}
else
{
...
...
src/Compilers/CSharp/Portable/Symbols/Source/SourceEventSymbol.cs
浏览文件 @
5b097cf6
...
...
@@ -423,7 +423,7 @@ private void CheckAccessibility(Location location, DiagnosticBag diagnostics, bo
DiagnosticBag
diagnostics
,
out
bool
modifierErrors
)
{
bool
isInterface
=
this
.
ContainingType
.
IsInterface
;
var
defaultAccess
=
isInterface
?
(
explicitInterfaceImplementation
?
DeclarationModifiers
.
Protected
:
DeclarationModifiers
.
Public
)
:
DeclarationModifiers
.
Private
;
var
defaultAccess
=
isInterface
&&
!
explicitInterfaceImplementation
?
DeclarationModifiers
.
Public
:
DeclarationModifiers
.
Private
;
var
defaultInterfaceImplementationModifiers
=
DeclarationModifiers
.
None
;
// Check that the set of modifiers is allowed
...
...
src/Compilers/CSharp/Portable/Symbols/Source/SourceOrdinaryMethodSymbol.cs
浏览文件 @
5b097cf6
...
...
@@ -831,7 +831,7 @@ private DeclarationModifiers MakeModifiers(SyntaxTokenList modifiers, MethodKind
{
bool
isInterface
=
this
.
ContainingType
.
IsInterface
;
bool
isExplicitInterfaceImplementation
=
methodKind
==
MethodKind
.
ExplicitInterfaceImplementation
;
var
defaultAccess
=
isInterface
&&
modifiers
.
IndexOf
(
SyntaxKind
.
PartialKeyword
)
<
0
?
(
isExplicitInterfaceImplementation
?
DeclarationModifiers
.
Protected
:
DeclarationModifiers
.
Public
)
:
DeclarationModifiers
.
Private
;
var
defaultAccess
=
isInterface
&&
modifiers
.
IndexOf
(
SyntaxKind
.
PartialKeyword
)
<
0
&&
!
isExplicitInterfaceImplementation
?
DeclarationModifiers
.
Public
:
DeclarationModifiers
.
Private
;
// Check that the set of modifiers is allowed
var
allowedModifiers
=
DeclarationModifiers
.
Partial
|
DeclarationModifiers
.
Unsafe
;
...
...
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertySymbol.cs
浏览文件 @
5b097cf6
...
...
@@ -835,7 +835,7 @@ private void CheckAccessibility(Location location, DiagnosticBag diagnostics, bo
Location
location
,
DiagnosticBag
diagnostics
,
out
bool
modifierErrors
)
{
bool
isInterface
=
this
.
ContainingType
.
IsInterface
;
var
defaultAccess
=
isInterface
?
(
isExplicitInterfaceImplementation
?
DeclarationModifiers
.
Protected
:
DeclarationModifiers
.
Public
)
:
DeclarationModifiers
.
Private
;
var
defaultAccess
=
isInterface
&&
!
isExplicitInterfaceImplementation
?
DeclarationModifiers
.
Public
:
DeclarationModifiers
.
Private
;
// Check that the set of modifiers is allowed
var
allowedModifiers
=
DeclarationModifiers
.
Unsafe
;
...
...
src/Compilers/CSharp/Test/Symbol/Symbols/DefaultInterfaceImplementationTests.cs
浏览文件 @
5b097cf6
...
...
@@ -29150,7 +29150,7 @@ private static void ValidateExplicitImplementation(MethodSymbol m1)
Assert.False(m1.IsExtern);
Assert.False(m1.IsAsync);
Assert.False(m1.IsOverride);
Assert.Equal(Accessibility.Pr
otected
, m1.DeclaredAccessibility);
Assert.Equal(Accessibility.Pr
ivate
, m1.DeclaredAccessibility);
if (m1.ContainingModule is PEModuleSymbol peModule)
{
...
...
@@ -29703,7 +29703,7 @@ private static void ValidateExplicitExternImplementation(MethodSymbol m1)
Assert.NotEqual(m1.OriginalDefinition is PEMethodSymbol, m1.IsExtern);
Assert.False(m1.IsAsync);
Assert.False(m1.IsOverride);
Assert.Equal(Accessibility.Pr
otected
, m1.DeclaredAccessibility);
Assert.Equal(Accessibility.Pr
ivate
, m1.DeclaredAccessibility);
if (m1.ContainingModule is PEModuleSymbol peModule)
{
...
...
@@ -29793,7 +29793,7 @@ void Validate2(MethodSymbol m1)
Assert.False(m1.IsExtern);
Assert.NotEqual(m1 is PEMethodSymbol, m1.IsAsync);
Assert.False(m1.IsOverride);
Assert.Equal(Accessibility.Pr
otected
, m1.DeclaredAccessibility);
Assert.Equal(Accessibility.Pr
ivate
, m1.DeclaredAccessibility);
if (m1.ContainingModule is PEModuleSymbol peModule)
{
...
...
@@ -32211,7 +32211,7 @@ private static void ValidateExplicitImplementation(PropertySymbol m1)
Assert.False(m1.IsStatic);
Assert.False(m1.IsExtern);
Assert.False(m1.IsOverride);
Assert.Equal(Accessibility.Pr
otected
, m1.DeclaredAccessibility);
Assert.Equal(Accessibility.Pr
ivate
, m1.DeclaredAccessibility);
ValidateAccessor(m1.GetMethod);
ValidateAccessor(m1.SetMethod);
...
...
@@ -32829,7 +32829,7 @@ private static void ValidateExplicitExternImplementation(PropertySymbol m1)
Assert.False(m1.IsStatic);
Assert.NotEqual(m1.OriginalDefinition is PEPropertySymbol, m1.IsExtern);
Assert.False(m1.IsOverride);
Assert.Equal(Accessibility.Pr
otected
, m1.DeclaredAccessibility);
Assert.Equal(Accessibility.Pr
ivate
, m1.DeclaredAccessibility);
ValidateAccessor(m1.GetMethod);
ValidateAccessor(m1.SetMethod);
...
...
@@ -34426,7 +34426,7 @@ private static void ValidateExplicitImplementation(EventSymbol m1)
Assert.False(m1.IsStatic);
Assert.False(m1.IsExtern);
Assert.False(m1.IsOverride);
Assert.Equal(Accessibility.Pr
otected
, m1.DeclaredAccessibility);
Assert.Equal(Accessibility.Pr
ivate
, m1.DeclaredAccessibility);
ValidateAccessor(m1.AddMethod);
ValidateAccessor(m1.RemoveMethod);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录