Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
70783542
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,发现更多精彩内容 >>
提交
70783542
编写于
10月 03, 2017
作者:
M
Manish Vasani
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Also expose the deconstruction assignment in foreach loop control variable declaration
Fixes #16372
上级
b0785d1f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
4 deletion
+28
-4
src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs
...lers/CSharp/Portable/Operations/CSharpOperationFactory.cs
+1
-1
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IForEachLoopStatement.cs
...antic/IOperation/IOperationTests_IForEachLoopStatement.cs
+19
-2
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ITupleExpression.cs
...t/Semantic/IOperation/IOperationTests_ITupleExpression.cs
+8
-1
未找到文件。
src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs
浏览文件 @
70783542
...
...
@@ -1251,7 +1251,7 @@ private IForEachLoopStatement CreateBoundForEachStatementOperation(BoundForEachS
Lazy
<
IOperation
>
loopControlVariable
;
if
(
boundForEachStatement
.
DeconstructionOpt
!=
null
)
{
loopControlVariable
=
new
Lazy
<
IOperation
>(()
=>
Create
(
boundForEachStatement
.
DeconstructionOpt
));
loopControlVariable
=
new
Lazy
<
IOperation
>(()
=>
Create
(
boundForEachStatement
.
DeconstructionOpt
.
DeconstructionAssignment
));
}
else
if
(
locals
.
Length
==
1
)
{
...
...
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IForEachLoopStatement.cs
浏览文件 @
70783542
...
...
@@ -872,7 +872,14 @@ public static void M((int, int)[] x)
IForEachLoopStatement (LoopKind.ForEach) (OperationKind.LoopStatement) (Syntax: 'foreach (va ... }')
Locals: Local_1: System.Int32 a
Local_2: System.Int32 b
LoopControlVariable: IOperation: (OperationKind.None) (Syntax: 'var (a, b)')
LoopControlVariable: IDeconstructionAssignmentExpression (OperationKind.DeconstructionAssignmentExpression, Type: (System.Int32 a, System.Int32 b)) (Syntax: 'var (a, b)')
Left: ITupleExpression (OperationKind.TupleExpression, Type: (System.Int32 a, System.Int32 b)) (Syntax: 'var (a, b)')
Elements(2):
ILocalReferenceExpression: a (IsDeclaration: True) (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'a')
ILocalReferenceExpression: b (IsDeclaration: True) (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'b')
Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: (System.Int32 a, System.Int32 b)) (Syntax: 'x')
Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
Operand: IPlaceholderExpression (OperationKind.None) (Syntax: 'x')
Collection: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'x')
Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null)
Operand: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: (System.Int32, System.Int32)[]) (Syntax: 'x')
...
...
@@ -904,7 +911,17 @@ public static void M((int, (int, int))[] x)
Locals: Local_1: System.Int32 a
Local_2: System.Int32 b
Local_3: System.Int32 c
LoopControlVariable: IOperation: (OperationKind.None) (Syntax: 'var (a, (b, c))')
LoopControlVariable: IDeconstructionAssignmentExpression (OperationKind.DeconstructionAssignmentExpression, Type: (System.Int32 a, (System.Int32 b, System.Int32 c))) (Syntax: 'var (a, (b, c))')
Left: ITupleExpression (OperationKind.TupleExpression, Type: (System.Int32 a, (System.Int32 b, System.Int32 c))) (Syntax: 'var (a, (b, c))')
Elements(2):
ILocalReferenceExpression: a (IsDeclaration: True) (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'a')
ITupleExpression (OperationKind.TupleExpression, Type: (System.Int32 b, System.Int32 c)) (Syntax: '(b, c)')
Elements(2):
ILocalReferenceExpression: b (IsDeclaration: True) (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'b')
ILocalReferenceExpression: c (IsDeclaration: True) (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'c')
Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: (System.Int32 a, (System.Int32 b, System.Int32 c))) (Syntax: 'x')
Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
Operand: IPlaceholderExpression (OperationKind.None) (Syntax: 'x')
Collection: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'x')
Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null)
Operand: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: (System.Int32, (System.Int32, System.Int32))[]) (Syntax: 'x')
...
...
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ITupleExpression.cs
浏览文件 @
70783542
...
...
@@ -986,7 +986,14 @@ public void M()
IForEachLoopStatement (LoopKind.ForEach) (OperationKind.LoopStatement) (Syntax: 'foreach (va ... }')
Locals: Local_1: System.UInt32 x
Local_2: System.UInt32 y
LoopControlVariable: IOperation: (OperationKind.None) (Syntax: 'var (x, y)')
LoopControlVariable: IDeconstructionAssignmentExpression (OperationKind.DeconstructionAssignmentExpression, Type: (System.UInt32 x, System.UInt32 y)) (Syntax: 'var (x, y)')
Left: ITupleExpression (OperationKind.TupleExpression, Type: (System.UInt32 x, System.UInt32 y)) (Syntax: 'var (x, y)')
Elements(2):
ILocalReferenceExpression: x (IsDeclaration: True) (OperationKind.LocalReferenceExpression, Type: System.UInt32) (Syntax: 'x')
ILocalReferenceExpression: y (IsDeclaration: True) (OperationKind.LocalReferenceExpression, Type: System.UInt32) (Syntax: 'y')
Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: (System.UInt32 x, System.UInt32 y)) (Syntax: 'new Point[] ... int(0, 1) }')
Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null)
Operand: IPlaceholderExpression (OperationKind.None) (Syntax: 'new Point[] ... int(0, 1) }')
Collection: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'new Point[] ... int(0, 1) }')
Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null)
Operand: IArrayCreationExpression (OperationKind.ArrayCreationExpression, Type: Point[]) (Syntax: 'new Point[] ... int(0, 1) }')
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录