Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
d65411ec
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,发现更多精彩内容 >>
未验证
提交
d65411ec
编写于
6月 25, 2018
作者:
F
Fred Silberberg
提交者:
GitHub
6月 25, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #28084 from 333fred/remove-workaround
Remove testoperationvisitor workaround now that bug is fixed.
上级
fab71342
6f6eda1f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
35 addition
and
16 deletion
+35
-16
src/Compilers/VisualBasic/Test/Semantic/Semantics/ConditionalAccessTests.vb
...alBasic/Test/Semantic/Semantics/ConditionalAccessTests.vb
+28
-1
src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs
...t/Utilities/Portable/Compilation/OperationTreeVerifier.cs
+1
-0
src/Test/Utilities/Portable/Compilation/TestOperationVisitor.cs
...st/Utilities/Portable/Compilation/TestOperationVisitor.cs
+6
-15
未找到文件。
src/Compilers/VisualBasic/Test/Semantic/Semantics/ConditionalAccessTests.vb
浏览文件 @
d65411ec
...
...
@@ -2984,6 +2984,7 @@ C1
End Sub
<CompilerTrait(CompilerFeature.IOperation)>
<Fact()>
Public Sub CodeGen_04()
...
...
@@ -3034,7 +3035,7 @@ Module Module1
Call (x(0))?.Test()
End Sub
Sub Test5(Of T As I1)(x as C1(Of T))
Sub Test5(Of T As I1)(x as C1(Of T))
'BIND:"
Sub
Test5
(
Of
T
As
I1
)(
x
as
C1
(
Of
T
))
"
With x.F2
?.Test()
End With
...
...
@@ -3084,6 +3085,32 @@ Test
102
]]>)
VerifyOperationTreeForTest(Of MethodBlockSyntax)(compilation, "
a
.
vb
", expectedOperationTree:="
IBlockOperation
(
3
statements
)
(
OperationKind
.
Block
,
Type
:
null
)
(
Syntax
:
'Sub Test5(O ... End Sub')
IWithOperation
(
OperationKind
.
None
,
Type
:
null
)
(
Syntax
:
'With x.F2 ... End With')
Value
:
IFieldReferenceOperation
:
C1
(
Of
T
).
F2
As
T
(
OperationKind
.
FieldReference
,
Type
:
T
)
(
Syntax
:
'x.F2')
Instance
Receiver
:
IParameterReferenceOperation
:
x
(
OperationKind
.
ParameterReference
,
Type
:
C1
(
Of
T
))
(
Syntax
:
'x')
Body
:
IBlockOperation
(
1
statements
)
(
OperationKind
.
Block
,
Type
:
null
,
IsImplicit
)
(
Syntax
:
'With x.F2 ... End With')
IExpressionStatementOperation
(
OperationKind
.
ExpressionStatement
,
Type
:
null
)
(
Syntax
:
'?.Test()')
Expression
:
IConditionalAccessOperation
(
OperationKind
.
ConditionalAccess
,
Type
:
System
.
Void
)
(
Syntax
:
'?.Test()')
Operation
:
IInstanceReferenceOperation
(
ReferenceKind
:
ImplicitReceiver
)
(
OperationKind
.
InstanceReference
,
Type
:
T
,
IsImplicit
)
(
Syntax
:
'x.F2')
WhenNotNull
:
IInvocationOperation
(
virtual
Sub
I1
.
Test
())
(
OperationKind
.
Invocation
,
Type
:
System
.
Void
)
(
Syntax
:
'.Test()')
Instance
Receiver
:
IConditionalAccessInstanceOperation
(
OperationKind
.
ConditionalAccessInstance
,
Type
:
T
,
IsImplicit
)
(
Syntax
:
'?.Test()')
Arguments
(
0
)
ILabeledOperation
(
Label
:
exit
)
(
OperationKind
.
Labeled
,
Type
:
null
,
IsImplicit
)
(
Syntax
:
'End Sub')
Statement
:
null
IReturnOperation
(
OperationKind
.
Return
,
Type
:
null
,
IsImplicit
)
(
Syntax
:
'End Sub')
ReturnedValue
:
null
")
End Sub
<Fact()>
...
...
src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs
浏览文件 @
d65411ec
...
...
@@ -102,6 +102,7 @@ private void LogCommonPropertiesAndNewLine(IOperation operation)
LogString
(
")"
);
// Syntax
Assert
.
NotNull
(
operation
.
Syntax
);
LogString
(
$" (Syntax:
{
GetSnippetFromSyntax
(
operation
.
Syntax
)}
)"
);
LogNewLine
();
...
...
src/Test/Utilities/Portable/Compilation/TestOperationVisitor.cs
浏览文件 @
d65411ec
...
...
@@ -44,26 +44,17 @@ public override void Visit(IOperation operation)
var
type
=
operation
.
Type
;
var
constantValue
=
operation
.
ConstantValue
;
// operation.Language can throw due to https://github.com/dotnet/roslyn/issues/23819
Assert
.
NotNull
(
syntax
);
// operation.Language can throw due to https://github.com/dotnet/roslyn/issues/23821
// Conditional logic below should be removed once the issue is fixed
if
(
syntax
!=
null
)
if
(
syntax
is
Microsoft
.
CodeAnalysis
.
Syntax
.
SyntaxList
)
{
// operation.Language can throw due to https://github.com/dotnet/roslyn/issues/23821
// Conditional logic below should be removed once the issue is fixed
if
(
syntax
is
Microsoft
.
CodeAnalysis
.
Syntax
.
SyntaxList
)
{
Assert
.
Equal
(
OperationKind
.
None
,
operation
.
Kind
);
Assert
.
Equal
(
LanguageNames
.
CSharp
,
operation
.
Parent
.
Language
);
}
else
{
var
language
=
operation
.
Language
;
}
Assert
.
Equal
(
OperationKind
.
None
,
operation
.
Kind
);
Assert
.
Equal
(
LanguageNames
.
CSharp
,
operation
.
Parent
.
Language
);
}
else
{
Assert
.
Equal
(
OperationKind
.
ConditionalAccessInstance
,
operation
.
Kind
);
Assert
.
Equal
(
LanguageNames
.
VisualBasic
,
operation
.
Parent
.
Language
);
var
language
=
operation
.
Language
;
}
var
isImplicit
=
operation
.
IsImplicit
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录