Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
dc394528
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,发现更多精彩内容 >>
未验证
提交
dc394528
编写于
6月 28, 2019
作者:
F
Fredric Silberberg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change SpeculativeModel property to GetSpeculativeModel method.
上级
9318f446
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
12 deletion
+6
-12
src/Compilers/CSharp/Portable/Compilation/MemberSemanticModel.cs
...pilers/CSharp/Portable/Compilation/MemberSemanticModel.cs
+5
-11
src/Compilers/CSharp/Portable/Compilation/MethodBodySemanticModel.cs
...rs/CSharp/Portable/Compilation/MethodBodySemanticModel.cs
+1
-1
未找到文件。
src/Compilers/CSharp/Portable/Compilation/MemberSemanticModel.cs
浏览文件 @
dc394528
...
@@ -141,14 +141,11 @@ internal override MemberSemanticModel GetMemberModel(SyntaxNode node)
...
@@ -141,14 +141,11 @@ internal override MemberSemanticModel GetMemberModel(SyntaxNode node)
// We hide this property, as EnsureRootBoundForNullabilityIfNecessary can cause
// We hide this property, as EnsureRootBoundForNullabilityIfNecessary can cause
// the cache to be populated.
// the cache to be populated.
[
DebuggerBrowsable
(
DebuggerBrowsableState
.
Never
)]
protected
NullableWalker
.
SnapshotManager
GetSnapshotManager
()
protected
NullableWalker
.
SnapshotManager
SnapshotManager
{
{
get
EnsureRootBoundForNullabilityIfNecessary
();
{
Debug
.
Assert
(
_lazySnapshotManager
is
object
||
!
Compilation
.
NullableSemanticAnalysisEnabled
);
EnsureRootBoundForNullabilityIfNecessary
();
return
_lazySnapshotManager
;
return
_lazySnapshotManager
;
}
}
}
internal
sealed
override
bool
TryGetSpeculativeSemanticModelCore
(
SyntaxTreeSemanticModel
parentModel
,
int
position
,
TypeSyntax
type
,
SpeculativeBindingOption
bindingOption
,
out
SemanticModel
speculativeModel
)
internal
sealed
override
bool
TryGetSpeculativeSemanticModelCore
(
SyntaxTreeSemanticModel
parentModel
,
int
position
,
TypeSyntax
type
,
SpeculativeBindingOption
bindingOption
,
out
SemanticModel
speculativeModel
)
...
@@ -185,16 +182,13 @@ internal override BoundExpression GetSpeculativelyBoundExpression(int position,
...
@@ -185,16 +182,13 @@ internal override BoundExpression GetSpeculativelyBoundExpression(int position,
return
GetSpeculativelyBoundExpressionWithoutNullability
(
position
,
expression
,
bindingOption
,
out
binder
,
out
crefSymbols
);
return
GetSpeculativelyBoundExpressionWithoutNullability
(
position
,
expression
,
bindingOption
,
out
binder
,
out
crefSymbols
);
}
}
EnsureRootBoundForNullabilityIfNecessary
();
Debug
.
Assert
(
SnapshotManager
is
object
);
crefSymbols
=
default
;
crefSymbols
=
default
;
position
=
CheckAndAdjustPosition
(
position
);
position
=
CheckAndAdjustPosition
(
position
);
expression
=
SyntaxFactory
.
GetStandaloneExpression
(
expression
);
expression
=
SyntaxFactory
.
GetStandaloneExpression
(
expression
);
var
bindableNewExpression
=
GetBindableSyntaxNode
(
expression
);
var
bindableNewExpression
=
GetBindableSyntaxNode
(
expression
);
binder
=
GetEnclosingBinder
(
position
);
binder
=
GetEnclosingBinder
(
position
);
var
boundRoot
=
Bind
(
binder
,
bindableNewExpression
,
_ignoredDiagnostics
);
var
boundRoot
=
Bind
(
binder
,
bindableNewExpression
,
_ignoredDiagnostics
);
return
(
BoundExpression
)
NullableWalker
.
AnalyzeAndRewriteSpeculation
(
position
,
boundRoot
,
binder
,
SnapshotManager
,
takeNewSnapshots
:
false
,
out
_
);
return
(
BoundExpression
)
NullableWalker
.
AnalyzeAndRewriteSpeculation
(
position
,
boundRoot
,
binder
,
GetSnapshotManager
()
,
takeNewSnapshots
:
false
,
out
_
);
}
}
private
Binder
GetEnclosingBinderInternalWithinRoot
(
SyntaxNode
node
,
int
position
)
private
Binder
GetEnclosingBinderInternalWithinRoot
(
SyntaxNode
node
,
int
position
)
...
...
src/Compilers/CSharp/Portable/Compilation/MethodBodySemanticModel.cs
浏览文件 @
dc394528
...
@@ -162,7 +162,7 @@ internal override bool TryGetSpeculativeSemanticModelCore(SyntaxTreeSemanticMode
...
@@ -162,7 +162,7 @@ internal override bool TryGetSpeculativeSemanticModelCore(SyntaxTreeSemanticMode
var
methodSymbol
=
(
MethodSymbol
)
this
.
MemberSymbol
;
var
methodSymbol
=
(
MethodSymbol
)
this
.
MemberSymbol
;
binder
=
new
ExecutableCodeBinder
(
statement
,
methodSymbol
,
binder
);
binder
=
new
ExecutableCodeBinder
(
statement
,
methodSymbol
,
binder
);
speculativeModel
=
CreateSpeculative
(
parentModel
,
methodSymbol
,
statement
,
binder
,
SnapshotManager
,
position
);
speculativeModel
=
CreateSpeculative
(
parentModel
,
methodSymbol
,
statement
,
binder
,
GetSnapshotManager
()
,
position
);
return
true
;
return
true
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录