Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
a2bffa1d
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,发现更多精彩内容 >>
提交
a2bffa1d
编写于
9月 17, 2020
作者:
C
Charles Stoner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
PR feedback
上级
1ae01176
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
43 deletion
+27
-43
src/Compilers/CSharp/Portable/Symbols/MemberSignatureComparer.cs
...pilers/CSharp/Portable/Symbols/MemberSignatureComparer.cs
+1
-1
src/Compilers/CSharp/Test/Symbol/Symbols/ExtendedPartialMethodsTests.cs
...CSharp/Test/Symbol/Symbols/ExtendedPartialMethodsTests.cs
+22
-40
src/Test/Utilities/Portable/Diagnostics/DiagnosticDescription.cs
...t/Utilities/Portable/Diagnostics/DiagnosticDescription.cs
+4
-2
未找到文件。
src/Compilers/CSharp/Portable/Symbols/MemberSignatureComparer.cs
浏览文件 @
a2bffa1d
...
...
@@ -137,7 +137,7 @@ internal class MemberSignatureComparer : IEqualityComparer<Symbol>
considerTypeConstraints
:
false
,
considerCallingConvention
:
false
,
considerRefKindDifferences
:
true
,
typeComparison
:
TypeCompareKind
.
ConsiderEverything
);
typeComparison
:
TypeCompareKind
.
ObliviousNullableModifierMatchesAny
);
/// <summary>
/// This instance is used to check whether one member overrides another, according to the C# definition.
...
...
src/Compilers/CSharp/Test/Symbol/Symbols/ExtendedPartialMethodsTests.cs
浏览文件 @
a2bffa1d
...
...
@@ -3087,28 +3087,28 @@ partial class C
public partial string M3();
public partial string? M3() => null; // 3
public partial string? M4();
public partial string M4() => ""hello"";
// 4
public partial string? M4();
// 4
public partial string M4() => ""hello"";
#nullable enable
public partial string M5();
public partial string M6() => null!;
// 5
public partial string M6() => null!;
public partial string M7();
public partial string M8() => null!; //
6
public partial string M8() => null!; //
5
public partial string? M9();
public partial string? M10() => null;
// 7
public partial string? M10() => null;
public partial string? M11();
public partial string? M12() => null;
#nullable disable
public partial string M5() => null;
// 8
public partial string M5() => null;
public partial string M6();
public partial string? M7() => null; //
9
public partial string? M8();
public partial string M9() => null;
// 10
public partial string? M7() => null; //
6
public partial string? M8();
// 7
public partial string M9() => null;
public partial string M10();
public partial string? M11() => null;
public partial string? M12();
public partial string? M11() => null;
// 8
public partial string? M12();
// 9
}"
;
var
comp
=
CreateCompilation
(
source
,
parseOptions
:
TestOptions
.
RegularWithExtendedPartialMethods
);
comp
.
VerifyDiagnostics
(
...
...
@@ -3119,19 +3119,19 @@ partial class C
// public partial string? M3() => null; // 3
Diagnostic
(
ErrorCode
.
WRN_MissingNonNullTypesContextForAnnotation
,
"?"
).
WithLocation
(
13
,
26
),
// (15,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M4();
// public partial string? M4();
// 4
Diagnostic
(
ErrorCode
.
WRN_MissingNonNullTypesContextForAnnotation
,
"?"
).
WithLocation
(
15
,
26
),
// (31,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M7() => null; //
9
// public partial string? M7() => null; //
6
Diagnostic
(
ErrorCode
.
WRN_MissingNonNullTypesContextForAnnotation
,
"?"
).
WithLocation
(
31
,
26
),
// (32,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M8();
// public partial string? M8();
// 7
Diagnostic
(
ErrorCode
.
WRN_MissingNonNullTypesContextForAnnotation
,
"?"
).
WithLocation
(
32
,
26
),
// (35,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M11() => null;
// public partial string? M11() => null;
// 8
Diagnostic
(
ErrorCode
.
WRN_MissingNonNullTypesContextForAnnotation
,
"?"
).
WithLocation
(
35
,
26
),
// (36,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M12();
// public partial string? M12();
// 9
Diagnostic
(
ErrorCode
.
WRN_MissingNonNullTypesContextForAnnotation
,
"?"
).
WithLocation
(
36
,
26
));
comp
=
CreateCompilation
(
source
,
options
:
TestOptions
.
ReleaseDllWithWarningLevel5
,
parseOptions
:
TestOptions
.
RegularWithExtendedPartialMethods
);
...
...
@@ -3145,41 +3145,23 @@ partial class C
// (13,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M3() => null; // 3
Diagnostic
(
ErrorCode
.
WRN_MissingNonNullTypesContextForAnnotation
,
"?"
).
WithLocation
(
13
,
26
),
// (13,28): warning CS8824: Partial method declarations 'string C.M3()' and 'string? C.M3()' have differences in parameter or return types.
// public partial string? M3() => null; // 3
Diagnostic
(
ErrorCode
.
WRN_PartialMethodTypeDifference
,
"M3"
).
WithArguments
(
"string C.M3()"
,
"string? C.M3()"
).
WithLocation
(
13
,
28
),
// (15,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M4();
// public partial string? M4();
// 4
Diagnostic
(
ErrorCode
.
WRN_MissingNonNullTypesContextForAnnotation
,
"?"
).
WithLocation
(
15
,
26
),
// (16,27): warning CS8824: Partial method declarations 'string? C.M4()' and 'string C.M4()' have differences in parameter or return types.
// public partial string M4() => "hello"; // 4
Diagnostic
(
ErrorCode
.
WRN_PartialMethodTypeDifference
,
"M4"
).
WithArguments
(
"string? C.M4()"
,
"string C.M4()"
).
WithLocation
(
16
,
27
),
// (20,27): warning CS8824: Partial method declarations 'string C.M6()' and 'string C.M6()' have differences in parameter or return types.
// public partial string M6() => null!; // 5
Diagnostic
(
ErrorCode
.
WRN_PartialMethodTypeDifference
,
"M6"
).
WithArguments
(
"string C.M6()"
,
"string C.M6()"
).
WithLocation
(
20
,
27
),
// (22,27): warning CS8824: Partial method declarations 'string? C.M8()' and 'string C.M8()' have differences in parameter or return types.
// public partial string M8() => null!; //
6
// public partial string M8() => null!; //
5
Diagnostic
(
ErrorCode
.
WRN_PartialMethodTypeDifference
,
"M8"
).
WithArguments
(
"string? C.M8()"
,
"string C.M8()"
).
WithLocation
(
22
,
27
),
// (24,28): warning CS8824: Partial method declarations 'string C.M10()' and 'string? C.M10()' have differences in parameter or return types.
// public partial string? M10() => null; // 7
Diagnostic
(
ErrorCode
.
WRN_PartialMethodTypeDifference
,
"M10"
).
WithArguments
(
"string C.M10()"
,
"string? C.M10()"
).
WithLocation
(
24
,
28
),
// (29,27): warning CS8824: Partial method declarations 'string C.M5()' and 'string C.M5()' have differences in parameter or return types.
// public partial string M5() => null; // 8
Diagnostic
(
ErrorCode
.
WRN_PartialMethodTypeDifference
,
"M5"
).
WithArguments
(
"string C.M5()"
,
"string C.M5()"
).
WithLocation
(
29
,
27
),
// (31,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M7() => null; //
9
// public partial string? M7() => null; //
6
Diagnostic
(
ErrorCode
.
WRN_MissingNonNullTypesContextForAnnotation
,
"?"
).
WithLocation
(
31
,
26
),
// (32,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M8();
// public partial string? M8();
// 7
Diagnostic
(
ErrorCode
.
WRN_MissingNonNullTypesContextForAnnotation
,
"?"
).
WithLocation
(
32
,
26
),
// (33,27): warning CS8824: Partial method declarations 'string? C.M9()' and 'string C.M9()' have differences in parameter or return types.
// public partial string M9() => null; // 10
Diagnostic
(
ErrorCode
.
WRN_PartialMethodTypeDifference
,
"M9"
).
WithArguments
(
"string? C.M9()"
,
"string C.M9()"
).
WithLocation
(
33
,
27
),
// (35,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M11() => null;
// public partial string? M11() => null;
// 8
Diagnostic
(
ErrorCode
.
WRN_MissingNonNullTypesContextForAnnotation
,
"?"
).
WithLocation
(
35
,
26
),
// (36,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M12();
// public partial string? M12();
// 9
Diagnostic
(
ErrorCode
.
WRN_MissingNonNullTypesContextForAnnotation
,
"?"
).
WithLocation
(
36
,
26
));
}
...
...
src/Test/Utilities/Portable/Diagnostics/DiagnosticDescription.cs
浏览文件 @
a2bffa1d
...
...
@@ -378,8 +378,10 @@ public override string ToString()
sb
.
Append
(
'"'
);
}
sb
.
Append
(
", isSuppressed: "
);
sb
.
Append
(
_isSuppressed
?
"true"
:
"false"
);
if
(
_isSuppressed
)
{
sb
.
Append
(
", isSuppressed: true"
);
}
sb
.
Append
(
")"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录