Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
42415c00
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,发现更多精彩内容 >>
提交
42415c00
编写于
12月 20, 2018
作者:
N
Neal Gafter
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix up merge
上级
ea2b6e6c
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
23 addition
and
36 deletion
+23
-36
src/Compilers/CSharp/Portable/Binder/Binder_Patterns.cs
src/Compilers/CSharp/Portable/Binder/Binder_Patterns.cs
+2
-2
src/Compilers/CSharp/Portable/Binder/Binder_Symbols.cs
src/Compilers/CSharp/Portable/Binder/Binder_Symbols.cs
+2
-2
src/Compilers/CSharp/Portable/Binder/DecisionDagBuilder.cs
src/Compilers/CSharp/Portable/Binder/DecisionDagBuilder.cs
+4
-4
src/Compilers/CSharp/Portable/Binder/SwitchExpressionBinder.cs
...ompilers/CSharp/Portable/Binder/SwitchExpressionBinder.cs
+2
-2
src/Compilers/CSharp/Portable/BoundTree/BoundDagTemp.cs
src/Compilers/CSharp/Portable/BoundTree/BoundDagTemp.cs
+1
-1
src/Compilers/CSharp/Portable/BoundTree/BoundNode_Source.cs
src/Compilers/CSharp/Portable/BoundTree/BoundNode_Source.cs
+1
-1
src/Compilers/CSharp/Portable/FlowAnalysis/AbstractFlowPass.cs
...ompilers/CSharp/Portable/FlowAnalysis/AbstractFlowPass.cs
+0
-9
src/Compilers/CSharp/Portable/Lowering/AsyncRewriter/AsyncRewriter.cs
...s/CSharp/Portable/Lowering/AsyncRewriter/AsyncRewriter.cs
+2
-2
src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Patterns.cs
...Portable/Lowering/LocalRewriter/LocalRewriter_Patterns.cs
+3
-3
src/Compilers/CSharp/Portable/Parser/LanguageParser_Patterns.cs
...mpilers/CSharp/Portable/Parser/LanguageParser_Patterns.cs
+2
-2
src/Compilers/Core/Portable/Microsoft.CodeAnalysis.csproj
src/Compilers/Core/Portable/Microsoft.CodeAnalysis.csproj
+2
-6
src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/WellKnownTypeValidationTests.vb
.../Test/Symbol/SymbolsTests/WellKnownTypeValidationTests.vb
+2
-2
未找到文件。
src/Compilers/CSharp/Portable/Binder/Binder_Patterns.cs
浏览文件 @
42415c00
...
...
@@ -161,7 +161,7 @@ private BoundPattern BindDiscardPattern(DiscardPatternSyntax node, TypeSymbol in
hasErrors
=
true
;
}
if
(
convertedExpression
.
Type
==
null
&&
constantValueOpt
!=
ConstantValue
.
Null
)
if
(
convertedExpression
.
Type
is
null
&&
constantValueOpt
!=
ConstantValue
.
Null
)
{
Debug
.
Assert
(
hasErrors
);
convertedExpression
=
new
BoundConversion
(
...
...
@@ -812,7 +812,7 @@ private BoundPattern BindVarPattern(VarPatternSyntax node, TypeSymbol inputType,
}
TypeSymbol
declType
=
inputType
;
Symbol
foundSymbol
=
BindTypeOrAliasOrKeyword
(
node
.
VarKeyword
,
node
,
diagnostics
,
out
bool
isVar
);
Symbol
foundSymbol
=
BindTypeOrAliasOrKeyword
(
node
.
VarKeyword
,
node
,
diagnostics
,
out
bool
isVar
)
.
NamespaceOrTypeSymbol
;
if
(!
isVar
)
{
// Give an error if there is a bindable type "var" in scope
...
...
src/Compilers/CSharp/Portable/Binder/Binder_Symbols.cs
浏览文件 @
42415c00
...
...
@@ -149,7 +149,7 @@ private NamespaceOrTypeOrAliasSymbolWithAnnotations BindTypeOrAliasOrKeyword(Ide
return
BindTypeOrAliasOrKeyword
(((
IdentifierNameSyntax
)
syntax
).
Identifier
,
syntax
,
diagnostics
,
out
isKeyword
);
}
private
Symbol
BindTypeOrAliasOrKeyword
(
SyntaxToken
identifier
,
SyntaxNode
syntax
,
DiagnosticBag
diagnostics
,
out
bool
isKeyword
)
private
NamespaceOrTypeOrAliasSymbolWithAnnotations
BindTypeOrAliasOrKeyword
(
SyntaxToken
identifier
,
SyntaxNode
syntax
,
DiagnosticBag
diagnostics
,
out
bool
isKeyword
)
{
// Keywords can only be IdentifierNameSyntax
var
identifierValueText
=
identifier
.
ValueText
;
...
...
@@ -246,7 +246,7 @@ private Symbol BindTypeOrAliasOrKeyword(SyntaxToken identifier, SyntaxNode synta
lookupResult
.
Free
();
return
NamespaceOrTypeOrAliasSymbolWithAnnotations
.
CreateUnannotated
(
IsNullableEnabled
(
syntax
.
I
dentifier
),
symbol
);
return
NamespaceOrTypeOrAliasSymbolWithAnnotations
.
CreateUnannotated
(
IsNullableEnabled
(
i
dentifier
),
symbol
);
}
// Binds the given expression syntax as Type.
...
...
src/Compilers/CSharp/Portable/Binder/DecisionDagBuilder.cs
浏览文件 @
42415c00
...
...
@@ -345,7 +345,7 @@ private DecisionDagBuilder(CSharpCompilation compilation, LabelSymbol defaultLab
BoundExpression
variableAccess
=
declaration
.
VariableAccess
;
if
(
variableAccess
!=
null
)
{
Debug
.
Assert
(
variableAccess
.
Type
==
input
.
Type
);
Debug
.
Assert
(
variableAccess
.
Type
.
Equals
(
input
.
Type
,
TypeCompareKind
.
AllIgnoreOptions
)
);
bindings
.
Add
(
new
BoundPatternBinding
(
variableAccess
,
input
));
}
else
...
...
@@ -376,7 +376,7 @@ private DecisionDagBuilder(CSharpCompilation compilation, LabelSymbol defaultLab
ArrayBuilder
<
BoundDagTest
>
tests
)
{
MakeCheckNotNull
(
input
,
syntax
,
tests
);
if
(
input
.
Type
!=
type
)
if
(
!
input
.
Type
.
Equals
(
type
,
TypeCompareKind
.
AllIgnoreOptions
)
)
{
TypeSymbol
inputType
=
input
.
Type
.
StrippedType
();
// since a null check has already been done
HashSet
<
DiagnosticInfo
>
useSiteDiagnostics
=
null
;
...
...
@@ -437,7 +437,7 @@ private static void Assert(bool condition, string message = null)
ArrayBuilder
<
BoundDagTest
>
tests
,
ArrayBuilder
<
BoundPatternBinding
>
bindings
)
{
Debug
.
Assert
(
input
.
Type
.
IsErrorType
()
||
recursive
.
InputType
.
IsErrorType
()
||
input
.
Type
==
recursive
.
InputType
);
Debug
.
Assert
(
input
.
Type
.
IsErrorType
()
||
recursive
.
InputType
.
IsErrorType
()
||
input
.
Type
.
Equals
(
recursive
.
InputType
,
TypeCompareKind
.
AllIgnoreOptions
)
);
var
inputType
=
recursive
.
DeclaredType
?.
Type
??
input
.
Type
.
StrippedType
();
input
=
MakeConvertToType
(
input
,
recursive
.
Syntax
,
inputType
,
tests
);
...
...
@@ -1259,7 +1259,7 @@ private static bool SameTest(BoundDagTest x, BoundDagTest y)
switch
(
x
.
Kind
)
{
case
BoundKind
.
DagTypeTest
:
return
((
BoundDagTypeTest
)
x
).
Type
==
((
BoundDagTypeTest
)
y
).
Type
;
return
((
BoundDagTypeTest
)
x
).
Type
.
Equals
(((
BoundDagTypeTest
)
y
).
Type
,
TypeCompareKind
.
AllIgnoreOptions
)
;
case
BoundKind
.
DagValueTest
:
return
((
BoundDagValueTest
)
x
).
Value
==
((
BoundDagValueTest
)
y
).
Value
;
...
...
src/Compilers/CSharp/Portable/Binder/SwitchExpressionBinder.cs
浏览文件 @
42415c00
...
...
@@ -123,7 +123,7 @@ private TypeSymbol InferResultType(ImmutableArray<BoundSwitchExpressionArm> swit
foreach
(
var
@case
in
switchCases
)
{
var
type
=
@case
.
Value
.
Type
;
if
(
type
!=
null
&&
seenTypes
.
Add
(
type
))
if
(
!(
type
is
null
)
&&
seenTypes
.
Add
(
type
))
{
typesInOrder
.
Add
(
type
);
}
...
...
@@ -132,7 +132,7 @@ private TypeSymbol InferResultType(ImmutableArray<BoundSwitchExpressionArm> swit
HashSet
<
DiagnosticInfo
>
useSiteDiagnostics
=
null
;
var
commonType
=
BestTypeInferrer
.
GetBestType
(
typesInOrder
,
Conversions
,
out
_
,
ref
useSiteDiagnostics
);
diagnostics
.
Add
(
SwitchExpressionSyntax
,
useSiteDiagnostics
);
if
(
commonType
==
null
)
if
(
commonType
is
null
)
{
diagnostics
.
Add
(
ErrorCode
.
ERR_SwitchExpressionNoBestType
,
SwitchExpressionSyntax
.
Location
);
commonType
=
CreateErrorType
();
...
...
src/Compilers/CSharp/Portable/BoundTree/BoundDagTemp.cs
浏览文件 @
42415c00
...
...
@@ -17,7 +17,7 @@ partial class BoundDagTemp
public
override
bool
Equals
(
object
obj
)
=>
obj
is
BoundDagTemp
other
&&
this
.
Equals
(
other
);
public
bool
Equals
(
BoundDagTemp
other
)
{
return
other
!=
(
object
)
null
&&
this
.
Type
==
other
.
Type
&&
object
.
Equals
(
this
.
Source
,
other
.
Source
)
&&
this
.
Index
==
other
.
Index
;
return
other
!=
(
object
)
null
&&
this
.
Type
.
Equals
(
other
.
Type
,
TypeCompareKind
.
AllIgnoreOptions
)
&&
object
.
Equals
(
this
.
Source
,
other
.
Source
)
&&
this
.
Index
==
other
.
Index
;
}
public
override
int
GetHashCode
()
{
...
...
src/Compilers/CSharp/Portable/BoundTree/BoundNode_Source.cs
浏览文件 @
42415c00
...
...
@@ -292,7 +292,7 @@ void appendSourceCore(BoundNode node, int indent, Dictionary<SynthesizedLocal, i
}
case
BoundSwitchLabel
label
:
{
appendSource
(
label
.
ExpressionOpt
);
appendSource
(
label
.
Pattern
);
break
;
}
case
BoundUnaryOperator
unary
:
...
...
src/Compilers/CSharp/Portable/FlowAnalysis/AbstractFlowPass.cs
浏览文件 @
42415c00
...
...
@@ -862,15 +862,6 @@ protected void RestorePending(SavedPending oldPending)
}
}
break
;
case
BoundKind
.
PatternSwitchSection
:
{
var
sec
=
(
BoundPatternSwitchSection
)
node
;
foreach
(
var
label
in
sec
.
SwitchLabels
)
{
stateChangedAfterUse
|=
ResolveBranches
(
label
.
Label
,
sec
);
}
}
break
;
default
:
// there are no other kinds of labels
throw
ExceptionUtilities
.
UnexpectedValue
(
node
.
Kind
);
...
...
src/Compilers/CSharp/Portable/Lowering/AsyncRewriter/AsyncRewriter.cs
浏览文件 @
42415c00
...
...
@@ -52,12 +52,12 @@ internal partial class AsyncRewriter : StateMachineRewriter
method
.
IsIAsyncEnumeratorReturningAsync
(
compilation
);
if
(
isAsyncEnumerableOrEnumerator
&&
!
method
.
IsIterator
)
{
bool
containsAwait
=
AwaitDetector
.
ContainsAwait
(
body
);
bool
containsAwait
=
AwaitDetector
.
ContainsAwait
(
body
WithAwaitLifted
);
diagnostics
.
Add
(
containsAwait
?
ErrorCode
.
ERR_PossibleAsyncIteratorWithoutYield
:
ErrorCode
.
ERR_PossibleAsyncIteratorWithoutYieldOrAwait
,
method
.
Locations
[
0
],
method
.
ReturnType
);
stateMachineType
=
null
;
return
body
;
return
body
WithAwaitLifted
;
}
// The CLR doesn't support adding fields to structs, so in order to enable EnC in an async method we need to generate a class.
...
...
src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Patterns.cs
浏览文件 @
42415c00
...
...
@@ -216,7 +216,7 @@ void addArg(RefKind refKind, BoundExpression expression)
{
// This is an evaluation of an indexed property with a constant int value.
// The input type must be ITuple, and the property must be a property of ITuple.
Debug
.
Assert
(
e
.
Property
.
ContainingSymbol
==
input
.
Type
);
Debug
.
Assert
(
e
.
Property
.
ContainingSymbol
.
Equals
(
input
.
Type
)
);
Debug
.
Assert
(
e
.
Property
.
GetMethod
.
ParameterCount
==
1
);
Debug
.
Assert
(
e
.
Property
.
GetMethod
.
Parameters
[
0
].
Type
.
SpecialType
==
SpecialType
.
System_Int32
);
TypeSymbol
type
=
e
.
Property
.
GetMethod
.
ReturnType
.
TypeSymbol
;
...
...
@@ -260,7 +260,7 @@ protected BoundExpression LowerTest(BoundDagTest test)
private
BoundExpression
MakeEqual
(
BoundExpression
loweredLiteral
,
BoundExpression
input
)
{
Debug
.
Assert
(
loweredLiteral
.
Type
==
input
.
Type
);
Debug
.
Assert
(
loweredLiteral
.
Type
.
Equals
(
input
.
Type
,
TypeCompareKind
.
AllIgnoreOptions
)
);
if
(
loweredLiteral
.
Type
.
SpecialType
==
SpecialType
.
System_Double
&&
double
.
IsNaN
(
loweredLiteral
.
ConstantValue
.
DoubleValue
))
{
...
...
@@ -340,7 +340,7 @@ private BoundExpression MakeEqual(BoundExpression loweredLiteral, BoundExpressio
if
(
test
is
BoundDagTypeTest
typeDecision
&&
evaluation
is
BoundDagTypeEvaluation
typeEvaluation
&&
typeDecision
.
Type
.
IsReferenceType
&&
typeEvaluation
.
Type
==
typeDecision
.
Type
&&
typeEvaluation
.
Type
.
Equals
(
typeDecision
.
Type
,
TypeCompareKind
.
AllIgnoreOptions
)
&&
typeEvaluation
.
Input
==
typeDecision
.
Input
)
{
...
...
src/Compilers/CSharp/Portable/Parser/LanguageParser_Patterns.cs
浏览文件 @
42415c00
...
...
@@ -47,7 +47,7 @@ private CSharpSyntaxNode ParseTypeOrPatternForIsOperatorCore()
switch
(
tk
)
{
case
SyntaxKind
.
IdentifierToken
when
this
.
CurrentToken
.
ContextualKind
==
SyntaxKind
.
UnderscoreToken
:
// We permit a type named `_` on the right-hand-side of an is operator, but not inside of a pattern.
// We permit a type named `_` on the right-hand-side of an is operator, but not inside of a pattern.
case
SyntaxKind
.
CloseParenToken
:
case
SyntaxKind
.
CloseBracketToken
:
case
SyntaxKind
.
CloseBraceToken
:
...
...
@@ -557,7 +557,7 @@ private PropertyPatternClauseSyntax ParsePropertyPatternClause()
var
list
=
_pool
.
AllocateSeparated
<
SubpatternSyntax
>();
try
{
tryAgain
:
tryAgain
:
if
(
this
.
IsPossibleSubpatternElement
()
||
this
.
CurrentToken
.
Kind
==
SyntaxKind
.
CommaToken
)
{
...
...
src/Compilers/Core/Portable/Microsoft.CodeAnalysis.csproj
浏览文件 @
42415c00
...
...
@@ -21,12 +21,8 @@
Do not install this package manually, it will be added as a prerequisite by other packages that require it.
</PackageDescription>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"
>
<LangVersion>
7.2
</LangVersion>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"
>
<LangVersion>
7.2
</LangVersion>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"
/>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"
/>
<ItemGroup>
<Content
Include=
"$(NuGetPackageRoot)\microsoft.diasymreader.native\$(MicrosoftDiaSymReaderNativeVersion)\runtimes\win\native\Microsoft.DiaSymReader.Native.x86.dll"
>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
...
...
src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/WellKnownTypeValidationTests.vb
浏览文件 @
42415c00
...
...
@@ -519,7 +519,7 @@ End Namespace
WellKnownType
.
System_Threading_Tasks_ValueTask_T
,
WellKnownType
.
System_Threading_Tasks_ValueTask
,
WellKnownType
.
System_Runtime_CompilerServices_AsyncIteratorMethodBuilder
,
WellKnownType
.
System_Threading_CancellationToken
WellKnownType
.
System_Threading_CancellationToken
,
WellKnownType
.
System_MatchFailureException
,
WellKnownType
.
System_Runtime_CompilerServices_NonNullTypesAttribute
,
WellKnownType
.
Microsoft_CodeAnalysis_EmbeddedAttribute
...
...
@@ -580,7 +580,7 @@ End Namespace
WellKnownType
.
System_Threading_Tasks_ValueTask_T
,
WellKnownType
.
System_Threading_Tasks_ValueTask
,
WellKnownType
.
System_Runtime_CompilerServices_AsyncIteratorMethodBuilder
,
WellKnownType
.
System_Threading_CancellationToken
WellKnownType
.
System_Threading_CancellationToken
,
WellKnownType
.
System_MatchFailureException
,
WellKnownType
.
System_Runtime_CompilerServices_NonNullTypesAttribute
,
WellKnownType
.
Microsoft_CodeAnalysis_EmbeddedAttribute
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录