Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
cea7157a
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,发现更多精彩内容 >>
提交
cea7157a
编写于
7月 11, 2016
作者:
N
Neal Gafter
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Sources missed in merge
上级
8ebda65c
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
13 addition
and
9 deletion
+13
-9
src/Compilers/CSharp/Portable/Binder/Semantics/Conversions/ConversionsBase.cs
.../Portable/Binder/Semantics/Conversions/ConversionsBase.cs
+4
-4
src/Compilers/CSharp/Portable/BoundTree/DecisionTree.cs
src/Compilers/CSharp/Portable/BoundTree/DecisionTree.cs
+2
-1
src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
+6
-3
src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticAnalyzerTests.AllInOne.cs
.../Semantic/Diagnostics/DiagnosticAnalyzerTests.AllInOne.cs
+1
-1
未找到文件。
src/Compilers/CSharp/Portable/Binder/Semantics/Conversions/ConversionsBase.cs
浏览文件 @
cea7157a
...
@@ -1244,7 +1244,7 @@ private static bool HasAnonymousFunctionConversion(BoundExpression source, TypeS
...
@@ -1244,7 +1244,7 @@ private static bool HasAnonymousFunctionConversion(BoundExpression source, TypeS
return
IsAnonymousFunctionCompatibleWithType
((
UnboundLambda
)
source
,
destination
)
==
LambdaConversionResult
.
Success
;
return
IsAnonymousFunctionCompatibleWithType
((
UnboundLambda
)
source
,
destination
)
==
LambdaConversionResult
.
Success
;
}
}
internal
Conversion
ClassifyImplicitUserDefinedConversionForSwitchGoverningType
(
TypeSymbol
sourceType
,
out
TypeSymbol
switchGoverningType
,
ref
HashSet
<
DiagnosticInfo
>
useSiteDiagnostics
)
internal
Conversion
ClassifyImplicitUserDefinedConversionFor
V6
SwitchGoverningType
(
TypeSymbol
sourceType
,
out
TypeSymbol
switchGoverningType
,
ref
HashSet
<
DiagnosticInfo
>
useSiteDiagnostics
)
{
{
// SPEC: The governing type of a switch statement is established by the switch expression.
// SPEC: The governing type of a switch statement is established by the switch expression.
// SPEC: 1) If the type of the switch expression is sbyte, byte, short, ushort, int, uint,
// SPEC: 1) If the type of the switch expression is sbyte, byte, short, ushort, int, uint,
...
@@ -1257,16 +1257,16 @@ internal Conversion ClassifyImplicitUserDefinedConversionForSwitchGoverningType(
...
@@ -1257,16 +1257,16 @@ internal Conversion ClassifyImplicitUserDefinedConversionForSwitchGoverningType(
// NOTE: We should be called only if (1) is false for source type.
// NOTE: We should be called only if (1) is false for source type.
Debug
.
Assert
((
object
)
sourceType
!=
null
);
Debug
.
Assert
((
object
)
sourceType
!=
null
);
Debug
.
Assert
(!
sourceType
.
IsValidSwitchGoverningType
());
Debug
.
Assert
(!
sourceType
.
IsValid
V6
SwitchGoverningType
());
UserDefinedConversionResult
result
=
AnalyzeImplicitUserDefinedConversionForSwitchGoverningType
(
sourceType
,
ref
useSiteDiagnostics
);
UserDefinedConversionResult
result
=
AnalyzeImplicitUserDefinedConversionFor
V6
SwitchGoverningType
(
sourceType
,
ref
useSiteDiagnostics
);
if
(
result
.
Kind
==
UserDefinedConversionResultKind
.
Valid
)
if
(
result
.
Kind
==
UserDefinedConversionResultKind
.
Valid
)
{
{
UserDefinedConversionAnalysis
analysis
=
result
.
Results
[
result
.
Best
];
UserDefinedConversionAnalysis
analysis
=
result
.
Results
[
result
.
Best
];
switchGoverningType
=
analysis
.
ToType
;
switchGoverningType
=
analysis
.
ToType
;
Debug
.
Assert
(
switchGoverningType
.
IsValidSwitchGoverningType
(
isTargetTypeOfUserDefinedOp
:
true
));
Debug
.
Assert
(
switchGoverningType
.
IsValid
V6
SwitchGoverningType
(
isTargetTypeOfUserDefinedOp
:
true
));
}
}
else
else
{
{
...
...
src/Compilers/CSharp/Portable/BoundTree/DecisionTree.cs
浏览文件 @
cea7157a
...
@@ -937,7 +937,8 @@ internal static class PatternConversionExtensions
...
@@ -937,7 +937,8 @@ internal static class PatternConversionExtensions
}
}
HashSet
<
DiagnosticInfo
>
useSiteDiagnostics
=
null
;
HashSet
<
DiagnosticInfo
>
useSiteDiagnostics
=
null
;
var
conversion
=
conversions
.
ClassifyConversion
(
expressionType
,
patternType
,
ref
useSiteDiagnostics
,
builtinOnly
:
true
);
var
conversion
=
conversions
.
ClassifyBuiltInConversion
(
expressionType
,
patternType
,
ref
useSiteDiagnostics
);
// This is for classification purposes only; we discard use-site diagnostics. Use-site diagnostics will
// This is for classification purposes only; we discard use-site diagnostics. Use-site diagnostics will
// be given if a conversion is actually used.
// be given if a conversion is actually used.
switch
(
conversion
.
Kind
)
switch
(
conversion
.
Kind
)
...
...
src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
浏览文件 @
cea7157a
...
@@ -1407,10 +1407,8 @@ internal enum ErrorCode
...
@@ -1407,10 +1407,8 @@ internal enum ErrorCode
ERR_RefReturnLocal
=
8924
,
ERR_RefReturnLocal
=
8924
,
ERR_RefReturnLocal2
=
8925
,
ERR_RefReturnLocal2
=
8925
,
ERR_RefReturnStructThis
=
8926
,
ERR_RefReturnStructThis
=
8926
,
ERR_ImplicitlyTypedOutVariableUsedInTheSameArgumentList
=
8927
,
ERR_TypeInferenceFailedForImplicitlyTypedOutVariable
=
8928
,
// Available = 8929,
// Available = 892
7-892
9,
ERR_MustBeRefAssignable
=
8930
,
ERR_MustBeRefAssignable
=
8930
,
ERR_MustBeRefAssignableLocal
=
8931
,
ERR_MustBeRefAssignableLocal
=
8931
,
...
@@ -1423,6 +1421,11 @@ internal enum ErrorCode
...
@@ -1423,6 +1421,11 @@ internal enum ErrorCode
ERR_BadIteratorLocalType
=
8941
,
ERR_BadIteratorLocalType
=
8941
,
ERR_BadAsyncLocalType
=
8942
,
ERR_BadAsyncLocalType
=
8942
,
ERR_RefReturningCallAndAwait
=
8943
,
ERR_RefReturningCallAndAwait
=
8943
,
#
endregion
diagnostics
for
ref
locals
and
ref
returns
introduced
in
C
#
7
#
region
diagnostics
for
out
var
ERR_ImplicitlyTypedOutVariableUsedInTheSameArgumentList
=
8944
,
ERR_TypeInferenceFailedForImplicitlyTypedOutVariable
=
8945
,
#
endregion
diagnostics
for
out
var
}
}
}
}
src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticAnalyzerTests.AllInOne.cs
浏览文件 @
cea7157a
...
@@ -28,7 +28,7 @@ public void DiagnosticAnalyzerAllInOne()
...
@@ -28,7 +28,7 @@ public void DiagnosticAnalyzerAllInOne()
var
syntaxKindsMissing
=
new
HashSet
<
SyntaxKind
>();
var
syntaxKindsMissing
=
new
HashSet
<
SyntaxKind
>();
// AllInOneCSharpCode has no deconstruction.
// AllInOneCSharpCode has no deconstruction.
syntaxKinds
Patterns
.
Add
(
SyntaxKind
.
VariableDeconstructionDeclarator
);
syntaxKinds
Missing
.
Add
(
SyntaxKind
.
VariableDeconstructionDeclarator
);
var
analyzer
=
new
CSharpTrackingDiagnosticAnalyzer
();
var
analyzer
=
new
CSharpTrackingDiagnosticAnalyzer
();
CreateCompilationWithMscorlib45
(
source
).
VerifyAnalyzerDiagnostics
(
new
[]
{
analyzer
});
CreateCompilationWithMscorlib45
(
source
).
VerifyAnalyzerDiagnostics
(
new
[]
{
analyzer
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录