Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
ef25ee7d
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,发现更多精彩内容 >>
未验证
提交
ef25ee7d
编写于
8月 16, 2017
作者:
F
Fredric Silberberg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor IConditionalChoiceExpression.
上级
0af5c44d
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
96 addition
and
96 deletion
+96
-96
src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs
...lers/CSharp/Portable/Operations/CSharpOperationFactory.cs
+2
-2
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IForLoopStatement.cs
.../Semantic/IOperation/IOperationTests_IForLoopStatement.cs
+3
-3
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IWhileUntilLoopStatement.cs
...ic/IOperation/IOperationTests_IWhileUntilLoopStatement.cs
+3
-3
src/Compilers/CSharp/Test/Symbol/Symbols/AnonymousTypesSemanticsTests.cs
...Sharp/Test/Symbol/Symbols/AnonymousTypesSemanticsTests.cs
+3
-3
src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs
...ilers/Core/Portable/Generated/Operations.xml.Generated.cs
+25
-25
src/Compilers/Core/Portable/Operations/IConditionalExpression.cs
...pilers/Core/Portable/Operations/IConditionalExpression.cs
+3
-3
src/Compilers/Core/Portable/Operations/OperationCloner.cs
src/Compilers/Core/Portable/Operations/OperationCloner.cs
+2
-2
src/Compilers/Core/Portable/Operations/OperationFactory.cs
src/Compilers/Core/Portable/Operations/OperationFactory.cs
+2
-2
src/Compilers/Core/Portable/Operations/OperationKind.cs
src/Compilers/Core/Portable/Operations/OperationKind.cs
+2
-2
src/Compilers/Core/Portable/Operations/OperationVisitor.cs
src/Compilers/Core/Portable/Operations/OperationVisitor.cs
+2
-2
src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
+7
-7
src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb
...lBasic/Portable/Operations/VisualBasicOperationFactory.vb
+2
-2
src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_Methods.vb
...ortable/Operations/VisualBasicOperationFactory_Methods.vb
+1
-1
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IForLoopStatement.vb
.../Semantic/IOperation/IOperationTests_IForLoopStatement.vb
+27
-27
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_InvalidStatement.vb
...t/Semantic/IOperation/IOperationTests_InvalidStatement.vb
+6
-6
src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs
...t/Utilities/Portable/Compilation/OperationTreeVerifier.cs
+4
-4
src/Test/Utilities/Portable/Compilation/TestOperationWalker.cs
...est/Utilities/Portable/Compilation/TestOperationWalker.cs
+2
-2
未找到文件。
src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs
浏览文件 @
ef25ee7d
...
...
@@ -902,7 +902,7 @@ private IBinaryOperatorExpression CreateBoundBinaryOperatorOperation(BoundBinary
return
new
LazyBinaryOperatorExpression
(
binaryOperationKind
,
leftOperand
,
rightOperand
,
isLifted
,
usesOperatorMethod
,
operatorMethod
,
_semanticModel
,
syntax
,
type
,
constantValue
,
isImplicit
);
}
private
IConditional
Choice
Expression
CreateBoundConditionalOperatorOperation
(
BoundConditionalOperator
boundConditionalOperator
)
private
IConditionalExpression
CreateBoundConditionalOperatorOperation
(
BoundConditionalOperator
boundConditionalOperator
)
{
Lazy
<
IOperation
>
condition
=
new
Lazy
<
IOperation
>(()
=>
Create
(
boundConditionalOperator
.
Condition
));
Lazy
<
IOperation
>
ifTrueValue
=
new
Lazy
<
IOperation
>(()
=>
Create
(
boundConditionalOperator
.
Consequence
));
...
...
@@ -911,7 +911,7 @@ private IConditionalChoiceExpression CreateBoundConditionalOperatorOperation(Bou
ITypeSymbol
type
=
boundConditionalOperator
.
Type
;
Optional
<
object
>
constantValue
=
ConvertToOptional
(
boundConditionalOperator
.
ConstantValue
);
bool
isImplicit
=
boundConditionalOperator
.
WasCompilerGenerated
;
return
new
LazyConditional
Choice
Expression
(
condition
,
ifTrueValue
,
ifFalseValue
,
_semanticModel
,
syntax
,
type
,
constantValue
,
isImplicit
);
return
new
LazyConditionalExpression
(
condition
,
ifTrueValue
,
ifFalseValue
,
_semanticModel
,
syntax
,
type
,
constantValue
,
isImplicit
);
}
private
ICoalesceExpression
CreateBoundNullCoalescingOperatorOperation
(
BoundNullCoalescingOperator
boundNullCoalescingOperator
)
...
...
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IForLoopStatement.cs
浏览文件 @
ef25ee7d
...
...
@@ -2063,7 +2063,7 @@ private void M()
IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'j = int.Try ... i) ? i : 0')
IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'j = int.Try ... i) ? i : 0')
Variables: Local_1: System.Int32 j
Initializer: IConditional
ChoiceExpression (OperationKind.ConditionalChoice
Expression, Type: System.Int32) (Syntax: 'int.TryPars ... i) ? i : 0')
Initializer: IConditional
Expression (OperationKind.Conditional
Expression, Type: System.Int32) (Syntax: 'int.TryPars ... i) ? i : 0')
Condition: IInvocationExpression (System.Boolean System.Int32.TryParse(System.String s, out System.Int32 result)) (OperationKind.InvocationExpression, Type: System.Boolean) (Syntax: 'int.TryPars ... out var i)')
Instance Receiver: null
Arguments(2):
...
...
@@ -2075,8 +2075,8 @@ private void M()
ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'var i')
InConversion: null
OutConversion: null
If
True: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'i')
If
False: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0')
When
True: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'i')
When
False: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0')
AtLoopBottom:
IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'i++')
Expression: IIncrementExpression (UnaryOperandKind.IntegerPostfixIncrement) (OperationKind.IncrementExpression, Type: System.Int32) (Syntax: 'i++')
...
...
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IWhileUntilLoopStatement.cs
浏览文件 @
ef25ee7d
...
...
@@ -965,10 +965,10 @@ static bool TakeOutParam<T>(T y, out T x)
Instance Receiver: null
Arguments(2):
IArgument (ArgumentKind.Explicit, Matching Parameter: y) (OperationKind.Argument) (Syntax: 'f ? 1 : 2')
IConditional
ChoiceExpression (OperationKind.ConditionalChoice
Expression, Type: System.Int32) (Syntax: 'f ? 1 : 2')
IConditional
Expression (OperationKind.Conditional
Expression, Type: System.Int32) (Syntax: 'f ? 1 : 2')
Condition: ILocalReferenceExpression: f (OperationKind.LocalReferenceExpression, Type: System.Boolean) (Syntax: 'f')
If
True: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1')
If
False: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2')
When
True: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1')
When
False: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2')
InConversion: null
OutConversion: null
IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'var x1')
...
...
src/Compilers/CSharp/Test/Symbol/Symbols/AnonymousTypesSemanticsTests.cs
浏览文件 @
ef25ee7d
...
...
@@ -1385,9 +1385,9 @@ public static void Main()
ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: <anonymous type: System.Int32 ProductID, System.String ProductName, System.Int32 SupplierID>) (Syntax: 'Conditional ... upplierID }')
Left: IPropertyReferenceExpression: <anonymous type: System.Int32 ProductID, System.String ProductName, System.Int32 SupplierID> <anonymous type: <anonymous type: System.Int32 ProductID, System.String ProductName, System.Int32 SupplierID> Conditional>.Conditional { get; } (Static) (OperationKind.PropertyReferenceExpression, Type: <anonymous type: System.Int32 ProductID, System.String ProductName, System.Int32 SupplierID>) (Syntax: 'Conditional')
Instance Receiver: null
Right: IConditional
ChoiceExpression (OperationKind.ConditionalChoice
Expression, Type: <anonymous type: System.Int32 ProductID, System.String ProductName, System.Int32 SupplierID>) (Syntax: 'false ? new ... upplierID }')
Right: IConditional
Expression (OperationKind.Conditional
Expression, Type: <anonymous type: System.Int32 ProductID, System.String ProductName, System.Int32 SupplierID>) (Syntax: 'false ? new ... upplierID }')
Condition: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: False) (Syntax: 'false')
If
True: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: <anonymous type: System.Int32 ProductID, System.String ProductName, System.Int32 SupplierID>) (Syntax: 'new { p.Pro ... upplierID }')
When
True: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: <anonymous type: System.Int32 ProductID, System.String ProductName, System.Int32 SupplierID>) (Syntax: 'new { p.Pro ... upplierID }')
Initializers(3):
IFieldReferenceExpression: System.Int32 Product.ProductID (OperationKind.FieldReferenceExpression, Type: System.Int32) (Syntax: 'p.ProductID')
Instance Receiver: IParameterReferenceExpression: p (OperationKind.ParameterReferenceExpression, Type: Product) (Syntax: 'p')
...
...
@@ -1395,7 +1395,7 @@ public static void Main()
Instance Receiver: IParameterReferenceExpression: p (OperationKind.ParameterReferenceExpression, Type: Product) (Syntax: 'p')
IFieldReferenceExpression: System.Int32 Product.SupplierID (OperationKind.FieldReferenceExpression, Type: System.Int32) (Syntax: 'p.SupplierID')
Instance Receiver: IParameterReferenceExpression: p (OperationKind.ParameterReferenceExpression, Type: Product) (Syntax: 'p')
If
False: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: <anonymous type: System.Int32 ProductID, System.String ProductName, System.Int32 SupplierID>) (Syntax: 'new { p.Pro ... upplierID }')
When
False: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: <anonymous type: System.Int32 ProductID, System.String ProductName, System.Int32 SupplierID>) (Syntax: 'new { p.Pro ... upplierID }')
Initializers(3):
IFieldReferenceExpression: System.Int32 Product.ProductID (OperationKind.FieldReferenceExpression, Type: System.Int32) (Syntax: 'p.ProductID')
Instance Receiver: IParameterReferenceExpression: p (OperationKind.ParameterReferenceExpression, Type: Product) (Syntax: 'p')
...
...
src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs
浏览文件 @
ef25ee7d
...
...
@@ -1121,23 +1121,23 @@ public override void Accept(OperationVisitor visitor)
/// <summary>
/// Represents a C# ?: or VB If expression.
/// </summary>
internal
abstract
partial
class
BaseConditional
ChoiceExpression
:
Operation
,
IConditionalChoice
Expression
internal
abstract
partial
class
BaseConditional
Expression
:
Operation
,
IConditional
Expression
{
protected
BaseConditional
Choice
Expression
(
SemanticModel
semanticModel
,
SyntaxNode
syntax
,
ITypeSymbol
type
,
Optional
<
object
>
constantValue
,
bool
isImplicit
)
:
base
(
OperationKind
.
Conditional
Choice
Expression
,
semanticModel
,
syntax
,
type
,
constantValue
,
isImplicit
)
protected
BaseConditionalExpression
(
SemanticModel
semanticModel
,
SyntaxNode
syntax
,
ITypeSymbol
type
,
Optional
<
object
>
constantValue
,
bool
isImplicit
)
:
base
(
OperationKind
.
ConditionalExpression
,
semanticModel
,
syntax
,
type
,
constantValue
,
isImplicit
)
{
}
protected
abstract
IOperation
ConditionImpl
{
get
;
}
protected
abstract
IOperation
IfTrueVal
ueImpl
{
get
;
}
protected
abstract
IOperation
IfFalseValu
eImpl
{
get
;
}
protected
abstract
IOperation
WhenTr
ueImpl
{
get
;
}
protected
abstract
IOperation
WhenFals
eImpl
{
get
;
}
public
override
IEnumerable
<
IOperation
>
Children
{
get
{
yield
return
Condition
;
yield
return
IfTrueVal
ue
;
yield
return
IfFalseValu
e
;
yield
return
WhenTr
ue
;
yield
return
WhenFals
e
;
}
}
/// <summary>
...
...
@@ -1147,60 +1147,60 @@ public override IEnumerable<IOperation> Children
/// <summary>
/// Value evaluated if the Condition is true.
/// </summary>
public
IOperation
IfTrueValue
=>
Operation
.
SetParentOperation
(
IfTrueVal
ueImpl
,
this
);
public
IOperation
WhenTrue
=>
Operation
.
SetParentOperation
(
WhenTr
ueImpl
,
this
);
/// <summary>
/// Value evaluated if the Condition is false.
/// </summary>
public
IOperation
IfFalseValue
=>
Operation
.
SetParentOperation
(
IfFalseValu
eImpl
,
this
);
public
IOperation
WhenFalse
=>
Operation
.
SetParentOperation
(
WhenFals
eImpl
,
this
);
public
override
void
Accept
(
OperationVisitor
visitor
)
{
visitor
.
VisitConditional
Choice
Expression
(
this
);
visitor
.
VisitConditionalExpression
(
this
);
}
public
override
TResult
Accept
<
TArgument
,
TResult
>(
OperationVisitor
<
TArgument
,
TResult
>
visitor
,
TArgument
argument
)
{
return
visitor
.
VisitConditional
Choice
Expression
(
this
,
argument
);
return
visitor
.
VisitConditionalExpression
(
this
,
argument
);
}
}
/// <summary>
/// Represents a C# ?: or VB If expression.
/// </summary>
internal
sealed
partial
class
Conditional
ChoiceExpression
:
BaseConditionalChoiceExpression
,
IConditionalChoice
Expression
internal
sealed
partial
class
Conditional
Expression
:
BaseConditionalExpression
,
IConditional
Expression
{
public
Conditional
ChoiceExpression
(
IOperation
condition
,
IOperation
ifTrueValue
,
IOperation
ifFalseValu
e
,
SemanticModel
semanticModel
,
SyntaxNode
syntax
,
ITypeSymbol
type
,
Optional
<
object
>
constantValue
,
bool
isImplicit
)
:
public
Conditional
Expression
(
IOperation
condition
,
IOperation
whenTrue
,
IOperation
whenFals
e
,
SemanticModel
semanticModel
,
SyntaxNode
syntax
,
ITypeSymbol
type
,
Optional
<
object
>
constantValue
,
bool
isImplicit
)
:
base
(
semanticModel
,
syntax
,
type
,
constantValue
,
isImplicit
)
{
ConditionImpl
=
condition
;
IfTrueValueImpl
=
ifTrueVal
ue
;
IfFalseValueImpl
=
ifFalseValu
e
;
WhenTrueImpl
=
whenTr
ue
;
WhenFalseImpl
=
whenFals
e
;
}
protected
override
IOperation
ConditionImpl
{
get
;
}
protected
override
IOperation
IfTrueVal
ueImpl
{
get
;
}
protected
override
IOperation
IfFalseValu
eImpl
{
get
;
}
protected
override
IOperation
WhenTr
ueImpl
{
get
;
}
protected
override
IOperation
WhenFals
eImpl
{
get
;
}
}
/// <summary>
/// Represents a C# ?: or VB If expression.
/// </summary>
internal
sealed
partial
class
LazyConditional
ChoiceExpression
:
BaseConditionalChoiceExpression
,
IConditionalChoice
Expression
internal
sealed
partial
class
LazyConditional
Expression
:
BaseConditionalExpression
,
IConditional
Expression
{
private
readonly
Lazy
<
IOperation
>
_lazyCondition
;
private
readonly
Lazy
<
IOperation
>
_lazy
IfTrueVal
ue
;
private
readonly
Lazy
<
IOperation
>
_lazy
IfFalseValu
e
;
private
readonly
Lazy
<
IOperation
>
_lazy
WhenTr
ue
;
private
readonly
Lazy
<
IOperation
>
_lazy
WhenFals
e
;
public
LazyConditional
ChoiceExpression
(
Lazy
<
IOperation
>
condition
,
Lazy
<
IOperation
>
ifTrueValue
,
Lazy
<
IOperation
>
ifFalseValu
e
,
SemanticModel
semanticModel
,
SyntaxNode
syntax
,
ITypeSymbol
type
,
Optional
<
object
>
constantValue
,
bool
isImplicit
)
:
base
(
semanticModel
,
syntax
,
type
,
constantValue
,
isImplicit
)
public
LazyConditional
Expression
(
Lazy
<
IOperation
>
condition
,
Lazy
<
IOperation
>
whenTrue
,
Lazy
<
IOperation
>
whenFals
e
,
SemanticModel
semanticModel
,
SyntaxNode
syntax
,
ITypeSymbol
type
,
Optional
<
object
>
constantValue
,
bool
isImplicit
)
:
base
(
semanticModel
,
syntax
,
type
,
constantValue
,
isImplicit
)
{
_lazyCondition
=
condition
??
throw
new
System
.
ArgumentNullException
(
nameof
(
condition
));
_lazy
IfTrueValue
=
ifTrueValue
??
throw
new
System
.
ArgumentNullException
(
nameof
(
ifTrueVal
ue
));
_lazy
IfFalseValue
=
ifFalseValue
??
throw
new
System
.
ArgumentNullException
(
nameof
(
ifFalseValu
e
));
_lazy
WhenTrue
=
whenTrue
??
throw
new
System
.
ArgumentNullException
(
nameof
(
whenTr
ue
));
_lazy
WhenFalse
=
whenFalse
??
throw
new
System
.
ArgumentNullException
(
nameof
(
whenFals
e
));
}
protected
override
IOperation
ConditionImpl
=>
_lazyCondition
.
Value
;
protected
override
IOperation
IfTrueValueImpl
=>
_lazyIfTrueVal
ue
.
Value
;
protected
override
IOperation
WhenTrueImpl
=>
_lazyWhenTr
ue
.
Value
;
protected
override
IOperation
IfFalseValueImpl
=>
_lazyIfFalseValu
e
.
Value
;
protected
override
IOperation
WhenFalseImpl
=>
_lazyWhenFals
e
.
Value
;
}
/// <summary>
...
...
src/Compilers/Core/Portable/Operations/IConditional
Choice
Expression.cs
→
src/Compilers/Core/Portable/Operations/IConditionalExpression.cs
浏览文件 @
ef25ee7d
...
...
@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Semantics
/// This interface is reserved for implementation by its associated APIs. We reserve the right to
/// change it in the future.
/// </remarks>
public
interface
IConditional
Choice
Expression
:
IOperation
public
interface
IConditionalExpression
:
IOperation
{
/// <summary>
/// Condition to be tested.
...
...
@@ -20,11 +20,11 @@ public interface IConditionalChoiceExpression : IOperation
/// <summary>
/// Value evaluated if the Condition is true.
/// </summary>
IOperation
IfTrueVal
ue
{
get
;
}
IOperation
WhenTr
ue
{
get
;
}
/// <summary>
/// Value evaluated if the Condition is false.
/// </summary>
IOperation
IfFalseValu
e
{
get
;
}
IOperation
WhenFals
e
{
get
;
}
}
}
src/Compilers/Core/Portable/Operations/OperationCloner.cs
浏览文件 @
ef25ee7d
...
...
@@ -269,9 +269,9 @@ public override IOperation VisitBinaryOperatorExpression(IBinaryOperatorExpressi
return
new
BinaryOperatorExpression
(
operation
.
BinaryOperationKind
,
Visit
(
operation
.
LeftOperand
),
Visit
(
operation
.
RightOperand
),
operation
.
IsLifted
,
operation
.
UsesOperatorMethod
,
operation
.
OperatorMethod
,
((
Operation
)
operation
).
SemanticModel
,
operation
.
Syntax
,
operation
.
Type
,
operation
.
ConstantValue
,
operation
.
IsImplicit
);
}
public
override
IOperation
VisitConditional
ChoiceExpression
(
IConditionalChoice
Expression
operation
,
object
argument
)
public
override
IOperation
VisitConditional
Expression
(
IConditional
Expression
operation
,
object
argument
)
{
return
new
Conditional
ChoiceExpression
(
Visit
(
operation
.
Condition
),
Visit
(
operation
.
IfTrueValue
),
Visit
(
operation
.
IfFalseValu
e
),
((
Operation
)
operation
).
SemanticModel
,
operation
.
Syntax
,
operation
.
Type
,
operation
.
ConstantValue
,
operation
.
IsImplicit
);
return
new
Conditional
Expression
(
Visit
(
operation
.
Condition
),
Visit
(
operation
.
WhenTrue
),
Visit
(
operation
.
WhenFals
e
),
((
Operation
)
operation
).
SemanticModel
,
operation
.
Syntax
,
operation
.
Type
,
operation
.
ConstantValue
,
operation
.
IsImplicit
);
}
public
override
IOperation
VisitCoalesceExpression
(
ICoalesceExpression
operation
,
object
argument
)
...
...
src/Compilers/Core/Portable/Operations/OperationFactory.cs
浏览文件 @
ef25ee7d
...
...
@@ -24,9 +24,9 @@ public static VariableDeclaration CreateVariableDeclaration(ImmutableArray<ILoca
isImplicit
:
false
);
// variable declaration is always explicit
}
public
static
IConditional
ChoiceExpression
CreateConditionalChoice
Expression
(
IOperation
condition
,
IOperation
ifTrue
,
IOperation
ifFalse
,
ITypeSymbol
resultType
,
SemanticModel
semanticModel
,
SyntaxNode
syntax
,
bool
isImplicit
)
public
static
IConditional
Expression
CreateConditional
Expression
(
IOperation
condition
,
IOperation
ifTrue
,
IOperation
ifFalse
,
ITypeSymbol
resultType
,
SemanticModel
semanticModel
,
SyntaxNode
syntax
,
bool
isImplicit
)
{
return
new
Conditional
Choice
Expression
(
return
new
ConditionalExpression
(
condition
,
ifTrue
,
ifFalse
,
...
...
src/Compilers/Core/Portable/Operations/OperationKind.cs
浏览文件 @
ef25ee7d
...
...
@@ -94,8 +94,8 @@ public enum OperationKind
UnaryOperatorExpression
=
0x10d
,
/// <summary>Indicates an <see cref="IBinaryOperatorExpression"/>.</summary>
BinaryOperatorExpression
=
0x10e
,
/// <summary>Indicates an <see cref="IConditional
Choice
Expression"/>.</summary>
Conditional
Choice
Expression
=
0x10f
,
/// <summary>Indicates an <see cref="IConditionalExpression"/>.</summary>
ConditionalExpression
=
0x10f
,
/// <summary>Indicates an <see cref="ICoalesceExpression"/>.</summary>
CoalesceExpression
=
0x110
,
/// <summary>Indicates an <see cref="IAnonymousFunctionExpression"/>.</summary>
...
...
src/Compilers/Core/Portable/Operations/OperationVisitor.cs
浏览文件 @
ef25ee7d
...
...
@@ -265,7 +265,7 @@ public virtual void VisitConversionExpression(IConversionExpression operation)
DefaultVisit
(
operation
);
}
public
virtual
void
VisitConditional
ChoiceExpression
(
IConditionalChoice
Expression
operation
)
public
virtual
void
VisitConditional
Expression
(
IConditional
Expression
operation
)
{
DefaultVisit
(
operation
);
}
...
...
@@ -735,7 +735,7 @@ public virtual TResult VisitConversionExpression(IConversionExpression operation
return
DefaultVisit
(
operation
,
argument
);
}
public
virtual
TResult
VisitConditional
ChoiceExpression
(
IConditionalChoice
Expression
operation
,
TArgument
argument
)
public
virtual
TResult
VisitConditional
Expression
(
IConditional
Expression
operation
,
TArgument
argument
)
{
return
DefaultVisit
(
operation
,
argument
);
}
...
...
src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
浏览文件 @
ef25ee7d
...
...
@@ -63,7 +63,7 @@ Microsoft.CodeAnalysis.OperationKind.CollectionElementInitializerExpression = 29
Microsoft.CodeAnalysis.OperationKind.CompoundAssignmentExpression = 281 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.ConditionalAccessExpression = 284 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.ConditionalAccessInstanceExpression = 285 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.Conditional
Choice
Expression = 271 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.ConditionalExpression = 271 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.ConstantPattern = 1039 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.ConversionExpression = 258 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.DeclarationPattern = 1040 -> Microsoft.CodeAnalysis.OperationKind
...
...
@@ -392,10 +392,10 @@ Microsoft.CodeAnalysis.Semantics.IConditionalAccessExpression
Microsoft.CodeAnalysis.Semantics.IConditionalAccessExpression.ConditionalInstance.get -> Microsoft.CodeAnalysis.IOperation
Microsoft.CodeAnalysis.Semantics.IConditionalAccessExpression.ConditionalValue.get -> Microsoft.CodeAnalysis.IOperation
Microsoft.CodeAnalysis.Semantics.IConditionalAccessInstanceExpression
Microsoft.CodeAnalysis.Semantics.IConditional
Choice
Expression
Microsoft.CodeAnalysis.Semantics.IConditional
Choice
Expression.Condition.get -> Microsoft.CodeAnalysis.IOperation
Microsoft.CodeAnalysis.Semantics.IConditional
ChoiceExpression.IfFalseValu
e.get -> Microsoft.CodeAnalysis.IOperation
Microsoft.CodeAnalysis.Semantics.IConditional
ChoiceExpression.IfTrueVal
ue.get -> Microsoft.CodeAnalysis.IOperation
Microsoft.CodeAnalysis.Semantics.IConditionalExpression
Microsoft.CodeAnalysis.Semantics.IConditionalExpression.Condition.get -> Microsoft.CodeAnalysis.IOperation
Microsoft.CodeAnalysis.Semantics.IConditional
Expression.WhenFals
e.get -> Microsoft.CodeAnalysis.IOperation
Microsoft.CodeAnalysis.Semantics.IConditional
Expression.WhenTr
ue.get -> Microsoft.CodeAnalysis.IOperation
Microsoft.CodeAnalysis.Semantics.IConstantPattern
Microsoft.CodeAnalysis.Semantics.IConstantPattern.Value.get -> Microsoft.CodeAnalysis.IOperation
Microsoft.CodeAnalysis.Semantics.IConversionExpression
...
...
@@ -790,7 +790,7 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitCollectionElement
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitCompoundAssignmentExpression(Microsoft.CodeAnalysis.Semantics.ICompoundAssignmentExpression operation) -> void
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitConditionalAccessExpression(Microsoft.CodeAnalysis.Semantics.IConditionalAccessExpression operation) -> void
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitConditionalAccessInstanceExpression(Microsoft.CodeAnalysis.Semantics.IConditionalAccessInstanceExpression operation) -> void
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitConditional
ChoiceExpression(Microsoft.CodeAnalysis.Semantics.IConditionalChoice
Expression operation) -> void
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitConditional
Expression(Microsoft.CodeAnalysis.Semantics.IConditional
Expression operation) -> void
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitConstantPattern(Microsoft.CodeAnalysis.Semantics.IConstantPattern operation) -> void
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitConversionExpression(Microsoft.CodeAnalysis.Semantics.IConversionExpression operation) -> void
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDeclarationPattern(Microsoft.CodeAnalysis.Semantics.IDeclarationPattern operation) -> void
...
...
@@ -880,7 +880,7 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.Vi
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitCompoundAssignmentExpression(Microsoft.CodeAnalysis.Semantics.ICompoundAssignmentExpression operation, TArgument argument) -> TResult
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitConditionalAccessExpression(Microsoft.CodeAnalysis.Semantics.IConditionalAccessExpression operation, TArgument argument) -> TResult
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitConditionalAccessInstanceExpression(Microsoft.CodeAnalysis.Semantics.IConditionalAccessInstanceExpression operation, TArgument argument) -> TResult
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitConditional
ChoiceExpression(Microsoft.CodeAnalysis.Semantics.IConditionalChoice
Expression operation, TArgument argument) -> TResult
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitConditional
Expression(Microsoft.CodeAnalysis.Semantics.IConditional
Expression operation, TArgument argument) -> TResult
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitConstantPattern(Microsoft.CodeAnalysis.Semantics.IConstantPattern operation, TArgument argument) -> TResult
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitConversionExpression(Microsoft.CodeAnalysis.Semantics.IConversionExpression operation, TArgument argument) -> TResult
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitDeclarationPattern(Microsoft.CodeAnalysis.Semantics.IDeclarationPattern operation, TArgument argument) -> TResult
...
...
src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb
浏览文件 @
ef25ee7d
...
...
@@ -545,7 +545,7 @@ Namespace Microsoft.CodeAnalysis.Semantics
Return
New
LazyVisualBasicConversionExpression
(
operand
,
conversion
,
isExplicit
,
isTryCast
,
isChecked
,
_semanticModel
,
syntax
,
type
,
constantValue
,
isImplicit
)
End
Function
Private
Function
CreateBoundTernaryConditionalExpressionOperation
(
boundTernaryConditionalExpression
As
BoundTernaryConditionalExpression
)
As
IConditional
Choice
Expression
Private
Function
CreateBoundTernaryConditionalExpressionOperation
(
boundTernaryConditionalExpression
As
BoundTernaryConditionalExpression
)
As
IConditionalExpression
Dim
condition
As
Lazy
(
Of
IOperation
)
=
New
Lazy
(
Of
IOperation
)(
Function
()
Create
(
boundTernaryConditionalExpression
.
Condition
))
Dim
ifTrueValue
As
Lazy
(
Of
IOperation
)
=
New
Lazy
(
Of
IOperation
)(
Function
()
Create
(
boundTernaryConditionalExpression
.
WhenTrue
))
Dim
ifFalseValue
As
Lazy
(
Of
IOperation
)
=
New
Lazy
(
Of
IOperation
)(
Function
()
Create
(
boundTernaryConditionalExpression
.
WhenFalse
))
...
...
@@ -553,7 +553,7 @@ Namespace Microsoft.CodeAnalysis.Semantics
Dim
type
As
ITypeSymbol
=
boundTernaryConditionalExpression
.
Type
Dim
constantValue
As
[
Optional
]
(
Of
Object
)
=
ConvertToOptional
(
boundTernaryConditionalExpression
.
ConstantValueOpt
)
Dim
isImplicit
As
Boolean
=
boundTernaryConditionalExpression
.
WasCompilerGenerated
Return
New
LazyConditional
Choice
Expression
(
condition
,
ifTrueValue
,
ifFalseValue
,
_semanticModel
,
syntax
,
type
,
constantValue
,
isImplicit
)
Return
New
LazyConditionalExpression
(
condition
,
ifTrueValue
,
ifFalseValue
,
_semanticModel
,
syntax
,
type
,
constantValue
,
isImplicit
)
End
Function
Private
Function
CreateBoundTypeOfOperation
(
boundTypeOf
As
BoundTypeOf
)
As
IIsTypeExpression
...
...
src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_Methods.vb
浏览文件 @
ef25ee7d
...
...
@@ -403,7 +403,7 @@ Namespace Microsoft.CodeAnalysis.Semantics
Dim
negativeStepRelationalCode
As
BinaryOperationKind
=
Helper
.
DeriveBinaryOperationKind
(
BinaryOperatorKind
.
GreaterThanOrEqual
,
controlVariable
)
Dim
negativeStepCondition
As
IOperation
=
OperationFactory
.
CreateBinaryOperatorExpression
(
negativeStepRelationalCode
,
_semanticModel
.
CloneOperation
(
Create
(
controlVariable
)),
_semanticModel
.
CloneOperation
(
limitValueReference
),
booleanType
,
_semanticModel
,
limitValueReference
.
Syntax
,
isLifted
,
limitValueReference
.
IsImplicit
)
Return
OperationFactory
.
CreateConditional
Choice
Expression
(
stepCondition
,
positiveStepCondition
,
negativeStepCondition
,
booleanType
,
_semanticModel
,
limitValueReference
.
Syntax
,
limitValueReference
.
IsImplicit
)
Return
OperationFactory
.
CreateConditionalExpression
(
stepCondition
,
positiveStepCondition
,
negativeStepCondition
,
booleanType
,
_semanticModel
,
limitValueReference
.
Syntax
,
limitValueReference
.
IsImplicit
)
End
If
End
If
End
Function
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IForLoopStatement.vb
浏览文件 @
ef25ee7d
...
...
@@ -87,14 +87,14 @@ End Class
Dim
expectedOperationTree
=
<
!
[
CDATA
[
IForLoopStatement
(
LoopKind
.
For
)
(
OperationKind
.
LoopStatement
)
(
Syntax
:
'For i As In ... Next')
Condition
:
IConditional
ChoiceExpression
(
OperationKind
.
ConditionalChoice
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'"1"')
Condition
:
IConditional
Expression
(
OperationKind
.
Conditional
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'"1"')
Condition
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
's')
Left
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopStepValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
's')
Right
:
ILiteralExpression
(
Text
:
0
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
0
)
(
Syntax
:
's')
If
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'"1"')
When
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'"1"')
Left
:
ILocalReferenceExpression
:
i
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'i As Integer')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'"1"')
If
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'"1"')
When
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'"1"')
Left
:
ILocalReferenceExpression
:
i
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'i As Integer')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'"1"')
Before
:
...
...
@@ -155,16 +155,16 @@ End Class
Dim
expectedOperationTree
=
<
!
[
CDATA
[
IForLoopStatement
(
LoopKind
.
For
)
(
OperationKind
.
LoopStatement
)
(
Syntax
:
'For i As Do ... Next')
Condition
:
IConditional
ChoiceExpression
(
OperationKind
.
ConditionalChoice
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'0')
Condition
:
IConditional
Expression
(
OperationKind
.
Conditional
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'0')
Condition
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
FloatingGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
's')
Left
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopStepValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Double
)
(
Syntax
:
's')
Right
:
ILiteralExpression
(
Text
:
0
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Double
,
Constant
:
0
)
(
Syntax
:
's')
If
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
FloatingLessThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'0')
When
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
FloatingLessThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'0')
Left
:
ILocalReferenceExpression
:
i
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Double
)
(
Syntax
:
'i As Double')
Right
:
IConversionExpression
(
Implicit
,
TryCast
:
False
,
Unchecked
)
(
OperationKind
.
ConversionExpression
,
Type
:
System
.
Double
,
Constant
:
0
)
(
Syntax
:
'0')
Conversion
:
CommonConversion
(
Exists
:
False
,
IsIdentity
:
False
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
Operand
:
ILiteralExpression
(
Text
:
0
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
0
)
(
Syntax
:
'0')
If
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
FloatingGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'0')
When
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
FloatingGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'0')
Left
:
ILocalReferenceExpression
:
i
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Double
)
(
Syntax
:
'i As Double')
Right
:
IConversionExpression
(
Implicit
,
TryCast
:
False
,
Unchecked
)
(
OperationKind
.
ConversionExpression
,
Type
:
System
.
Double
,
Constant
:
0
)
(
Syntax
:
'0')
Conversion
:
CommonConversion
(
Exists
:
False
,
IsIdentity
:
False
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
...
...
@@ -222,14 +222,14 @@ End Class
Dim
expectedOperationTree
=
<
!
[
CDATA
[
IForLoopStatement
(
LoopKind
.
For
)
(
OperationKind
.
LoopStatement
)
(
Syntax
:
'For ctrlVar ... Next')
Condition
:
IConditional
ChoiceExpression
(
OperationKind
.
ConditionalChoice
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'limit')
Condition
:
IConditional
Expression
(
OperationKind
.
Conditional
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'limit')
Condition
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
ObjectGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'stp')
Left
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopStepValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Object
)
(
Syntax
:
'stp')
Right
:
ILiteralExpression
(
Text
:
1
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Object
,
Constant
:
1
)
(
Syntax
:
'stp')
If
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
ObjectLessThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'limit')
When
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
ObjectLessThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'limit')
Left
:
ILocalReferenceExpression
:
ctrlVar
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Object
)
(
Syntax
:
'ctrlVar')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Object
)
(
Syntax
:
'limit')
If
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
ObjectGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'limit')
When
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
ObjectGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'limit')
Left
:
ILocalReferenceExpression
:
ctrlVar
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Object
)
(
Syntax
:
'ctrlVar')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Object
)
(
Syntax
:
'limit')
Before
:
...
...
@@ -1097,14 +1097,14 @@ End Structure
Dim
expectedOperationTree
=
<
!
[
CDATA
[
IForLoopStatement
(
LoopKind
.
For
)
(
OperationKind
.
LoopStatement
)
(
Syntax
:
'For x = 12 ... Next')
Condition
:
IConditional
ChoiceExpression
(
OperationKind
.
ConditionalChoice
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Condition
:
IConditional
Expression
(
OperationKind
.
Conditional
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Condition
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'For x = 12 ... Next')
Left
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopStepValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'For x = 12 ... Next')
Right
:
ILiteralExpression
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
),
Constant
:
null
)
(
Syntax
:
'For x = 12 ... Next')
If
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
When
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Left
:
ILocalReferenceExpression
:
x
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'x')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'y')
If
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
When
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Left
:
ILocalReferenceExpression
:
x
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'x')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'y')
Before
:
...
...
@@ -1196,14 +1196,14 @@ End Structure
Dim
expectedOperationTree
=
<
!
[
CDATA
[
IForLoopStatement
(
LoopKind
.
For
)
(
OperationKind
.
LoopStatement
)
(
Syntax
:
'For x = 12 ... Next')
Condition
:
IConditional
ChoiceExpression
(
OperationKind
.
ConditionalChoice
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Condition
:
IConditional
Expression
(
OperationKind
.
Conditional
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Condition
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'For x = 12 ... Next')
Left
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopStepValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'For x = 12 ... Next')
Right
:
ILiteralExpression
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
),
Constant
:
null
)
(
Syntax
:
'For x = 12 ... Next')
If
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
When
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Left
:
ILocalReferenceExpression
:
x
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'x')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'y')
If
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
When
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Left
:
ILocalReferenceExpression
:
x
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'x')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'y')
Before
:
...
...
@@ -1251,14 +1251,14 @@ End Structure
Dim
expectedOperationTree
=
<
!
[
CDATA
[
IForLoopStatement
(
LoopKind
.
For
)
(
OperationKind
.
LoopStatement
)
(
Syntax
:
'For x = 12 ... Next')
Condition
:
IConditional
ChoiceExpression
(
OperationKind
.
ConditionalChoice
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Condition
:
IConditional
Expression
(
OperationKind
.
Conditional
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Condition
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
's')
Left
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopStepValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
's')
Right
:
ILiteralExpression
(
Text
:
0
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
0
)
(
Syntax
:
's')
If
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
When
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Left
:
ILocalReferenceExpression
:
x
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'x')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'y')
If
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
When
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Left
:
ILocalReferenceExpression
:
x
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'x')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'y')
Before
:
...
...
@@ -1304,14 +1304,14 @@ End Structure
Dim
expectedOperationTree
=
<
!
[
CDATA
[
IForLoopStatement
(
LoopKind
.
For
)
(
OperationKind
.
LoopStatement
)
(
Syntax
:
'For x = 12 ... Next')
Condition
:
IConditional
ChoiceExpression
(
OperationKind
.
ConditionalChoice
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Condition
:
IConditional
Expression
(
OperationKind
.
Conditional
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Condition
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
's')
Left
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopStepValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
's')
Right
:
ILiteralExpression
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
),
Constant
:
null
)
(
Syntax
:
's')
If
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
When
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Left
:
ILocalReferenceExpression
:
x
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'x')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'y')
If
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
When
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Left
:
ILocalReferenceExpression
:
x
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'x')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'y')
Before
:
...
...
@@ -1359,14 +1359,14 @@ End Structure
Dim
expectedOperationTree
=
<
!
[
CDATA
[
IForLoopStatement
(
LoopKind
.
For
)
(
OperationKind
.
LoopStatement
)
(
Syntax
:
'For x = 12 ... Next')
Condition
:
IConditional
ChoiceExpression
(
OperationKind
.
ConditionalChoice
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Condition
:
IConditional
Expression
(
OperationKind
.
Conditional
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Condition
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
's')
Left
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopStepValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
's')
Right
:
ILiteralExpression
(
Text
:
0
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
0
)
(
Syntax
:
's')
If
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
When
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Left
:
ILocalReferenceExpression
:
x
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'x')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'y')
If
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
When
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Left
:
ILocalReferenceExpression
:
x
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'x')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'y')
Before
:
...
...
@@ -1414,14 +1414,14 @@ End Structure
Dim
expectedOperationTree
=
<
!
[
CDATA
[
IForLoopStatement
(
LoopKind
.
For
)
(
OperationKind
.
LoopStatement
)
(
Syntax
:
'For x = 12 ... Next')
Condition
:
IConditional
ChoiceExpression
(
OperationKind
.
ConditionalChoice
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Condition
:
IConditional
Expression
(
OperationKind
.
Conditional
Expression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Condition
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
's')
Left
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopStepValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
's')
Right
:
ILiteralExpression
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
),
Constant
:
null
)
(
Syntax
:
's')
If
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
When
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Left
:
ILocalReferenceExpression
:
x
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'x')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'y')
If
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
When
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
-
IsLifted
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'y')
Left
:
ILocalReferenceExpression
:
x
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'x')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Nullable
(
Of
System
.
Int32
))
(
Syntax
:
'y')
Before
:
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_InvalidStatement.vb
浏览文件 @
ef25ee7d
...
...
@@ -260,14 +260,14 @@ End Module]]>.Value
Dim
expectedOperationTree
=
<
!
[
CDATA
[
IForLoopStatement
(
LoopKind
.
For
)
(
OperationKind
.
LoopStatement
,
IsInvalid
)
(
Syntax
:
'For Step (M ... Next')
Condition
:
IConditional
ChoiceExpression
(
OperationKind
.
ConditionalChoice
Expression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'')
Condition
:
IConditional
Expression
(
OperationKind
.
Conditional
Expression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'')
Condition
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
ObjectGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'For Step (M ... Next')
Left
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopStepValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Object
,
IsInvalid
)
(
Syntax
:
'For Step (M ... Next')
Right
:
ILiteralExpression
(
Text
:
1
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Object
,
Constant
:
1
,
IsInvalid
)
(
Syntax
:
'For Step (M ... Next')
If
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
ObjectLessThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'')
When
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
ObjectLessThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'')
Left
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Object
,
IsInvalid
)
(
Syntax
:
'')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Object
,
IsInvalid
)
(
Syntax
:
'')
If
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
ObjectGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'')
When
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
ObjectGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'')
Left
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Object
,
IsInvalid
)
(
Syntax
:
'')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Object
,
IsInvalid
)
(
Syntax
:
'')
Before
:
...
...
@@ -330,14 +330,14 @@ End Module]]>.Value
Dim
expectedOperationTree
=
<
!
[
CDATA
[
IForLoopStatement
(
LoopKind
.
For
)
(
OperationKind
.
LoopStatement
,
IsInvalid
)
(
Syntax
:
'For i As In ... Next i')
Condition
:
IConditional
ChoiceExpression
(
OperationKind
.
ConditionalChoice
Expression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'Program')
Condition
:
IConditional
Expression
(
OperationKind
.
Conditional
Expression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'Program')
Condition
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'x')
Left
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopStepValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Int32
,
IsInvalid
)
(
Syntax
:
'x')
Right
:
ILiteralExpression
(
Text
:
0
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
0
,
IsInvalid
)
(
Syntax
:
'x')
If
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'Program')
When
True
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'Program')
Left
:
ILocalReferenceExpression
:
i
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'i As Integer')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Int32
,
IsInvalid
)
(
Syntax
:
'Program')
If
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'Program')
When
False
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerGreaterThanOrEqual
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'Program')
Left
:
ILocalReferenceExpression
:
i
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'i As Integer')
Right
:
ISyntheticLocalReferenceExpression
(
SynthesizedLocalKind
.
ForLoopLimitValue
)
(
OperationKind
.
SyntheticLocalReferenceExpression
,
Type
:
System
.
Int32
,
IsInvalid
)
(
Syntax
:
'Program')
Before
:
...
...
src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs
浏览文件 @
ef25ee7d
...
...
@@ -855,14 +855,14 @@ public override void VisitConversionExpression(IConversionExpression operation)
Visit
(
operation
.
Operand
,
"Operand"
);
}
public
override
void
VisitConditional
ChoiceExpression
(
IConditionalChoice
Expression
operation
)
public
override
void
VisitConditional
Expression
(
IConditional
Expression
operation
)
{
LogString
(
nameof
(
IConditional
Choice
Expression
));
LogString
(
nameof
(
IConditionalExpression
));
LogCommonPropertiesAndNewLine
(
operation
);
Visit
(
operation
.
Condition
,
"Condition"
);
Visit
(
operation
.
IfTrueValue
,
"If
True"
);
Visit
(
operation
.
IfFalseValue
,
"If
False"
);
Visit
(
operation
.
WhenTrue
,
"When
True"
);
Visit
(
operation
.
WhenFalse
,
"When
False"
);
}
public
override
void
VisitCoalesceExpression
(
ICoalesceExpression
operation
)
...
...
src/Test/Utilities/Portable/Compilation/TestOperationWalker.cs
浏览文件 @
ef25ee7d
...
...
@@ -367,9 +367,9 @@ public override void VisitConversionExpression(IConversionExpression operation)
base
.
VisitConversionExpression
(
operation
);
}
public
override
void
VisitConditional
ChoiceExpression
(
IConditionalChoice
Expression
operation
)
public
override
void
VisitConditional
Expression
(
IConditional
Expression
operation
)
{
base
.
VisitConditional
Choice
Expression
(
operation
);
base
.
VisitConditionalExpression
(
operation
);
}
public
override
void
VisitCoalesceExpression
(
ICoalesceExpression
operation
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录