Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
a298f642
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,发现更多精彩内容 >>
未验证
提交
a298f642
编写于
8月 23, 2017
作者:
F
Fredric Silberberg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added IsDeclaration to BoundFieldAccess nodes.
上级
091200ab
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
10 deletion
+17
-10
src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs
src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs
+1
-1
src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml
src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml
+1
-0
src/Compilers/CSharp/Portable/BoundTree/Constructors.cs
src/Compilers/CSharp/Portable/BoundTree/Constructors.cs
+4
-3
src/Compilers/CSharp/Portable/BoundTree/VariablePendingInference.cs
...ers/CSharp/Portable/BoundTree/VariablePendingInference.cs
+2
-1
src/Compilers/CSharp/Portable/Generated/BoundNodes.xml.Generated.cs
...ers/CSharp/Portable/Generated/BoundNodes.xml.Generated.cs
+9
-5
未找到文件。
src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs
浏览文件 @
a298f642
...
...
@@ -2390,7 +2390,7 @@ private BoundExpression BindOutDeclarationArgument(DeclarationExpressionSyntax d
TypeSymbol
fieldType
=
expressionVariableField
.
GetFieldType
(
this
.
FieldsBeingBound
);
return
new
BoundFieldAccess
(
declarationExpression
,
receiver
,
expressionVariableField
,
null
,
LookupResultKind
.
Viable
,
fieldType
);
expressionVariableField
,
null
,
LookupResultKind
.
Viable
,
fieldType
,
isDeclaration
:
true
);
}
/// <summary>
...
...
src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml
浏览文件 @
a298f642
...
...
@@ -1450,6 +1450,7 @@
<Field
Name=
"ConstantValueOpt"
Type=
"ConstantValue"
Null=
"allow"
/>
<Field
Name=
"ResultKind"
PropertyOverrides=
"true"
Type=
"LookupResultKind"
/>
<Field
Name=
"IsByValue"
Type=
"bool"
/>
<Field
Name=
"IsDeclaration"
Type=
"bool"
/>
</Node>
<!--
...
...
src/Compilers/CSharp/Portable/BoundTree/Constructors.cs
浏览文件 @
a298f642
...
...
@@ -25,8 +25,9 @@ internal sealed partial class BoundFieldAccess
ConstantValue
constantValueOpt
,
LookupResultKind
resultKind
,
TypeSymbol
type
,
bool
hasErrors
=
false
)
:
this
(
syntax
,
receiver
,
fieldSymbol
,
constantValueOpt
,
resultKind
,
NeedsByValueFieldAccess
(
receiver
,
fieldSymbol
),
type
,
hasErrors
)
bool
hasErrors
=
false
,
bool
isDeclaration
=
false
)
:
this
(
syntax
,
receiver
,
fieldSymbol
,
constantValueOpt
,
resultKind
,
NeedsByValueFieldAccess
(
receiver
,
fieldSymbol
),
isDeclaration
,
type
,
hasErrors
)
{
}
...
...
@@ -37,7 +38,7 @@ internal sealed partial class BoundFieldAccess
LookupResultKind
resultKind
,
TypeSymbol
typeSymbol
)
{
return
this
.
Update
(
receiver
,
fieldSymbol
,
constantValueOpt
,
resultKind
,
this
.
IsByValue
,
typeSymbol
);
return
this
.
Update
(
receiver
,
fieldSymbol
,
constantValueOpt
,
resultKind
,
this
.
IsByValue
,
t
his
.
IsDeclaration
,
t
ypeSymbol
);
}
private
static
bool
NeedsByValueFieldAccess
(
BoundExpression
receiver
,
FieldSymbol
fieldSymbol
)
...
...
src/Compilers/CSharp/Portable/BoundTree/VariablePendingInference.cs
浏览文件 @
a298f642
...
...
@@ -80,7 +80,8 @@ internal BoundExpression SetInferredType(TypeSymbol type, Binder binderOpt, Diag
return
new
BoundFieldAccess
(
this
.
Syntax
,
this
.
ReceiverOpt
,
fieldSymbol
,
null
,
LookupResultKind
.
Viable
,
type
,
this
.
HasErrors
||
inferenceFailed
);
this
.
HasErrors
||
inferenceFailed
,
isDeclaration
:
true
);
default
:
throw
ExceptionUtilities
.
UnexpectedValue
(
this
.
VariableSymbol
.
Kind
);
...
...
src/Compilers/CSharp/Portable/Generated/BoundNodes.xml.Generated.cs
浏览文件 @
a298f642
...
...
@@ -5263,7 +5263,7 @@ public BoundStackAllocArrayCreation Update(BoundExpression count, TypeSymbol typ
internal
sealed
partial
class
BoundFieldAccess
:
BoundExpression
{
public
BoundFieldAccess
(
SyntaxNode
syntax
,
BoundExpression
receiverOpt
,
FieldSymbol
fieldSymbol
,
ConstantValue
constantValueOpt
,
LookupResultKind
resultKind
,
bool
isByValue
,
TypeSymbol
type
,
bool
hasErrors
=
false
)
public
BoundFieldAccess
(
SyntaxNode
syntax
,
BoundExpression
receiverOpt
,
FieldSymbol
fieldSymbol
,
ConstantValue
constantValueOpt
,
LookupResultKind
resultKind
,
bool
isByValue
,
bool
isDeclaration
,
TypeSymbol
type
,
bool
hasErrors
=
false
)
:
base
(
BoundKind
.
FieldAccess
,
syntax
,
type
,
hasErrors
||
receiverOpt
.
HasErrors
())
{
...
...
@@ -5275,6 +5275,7 @@ public BoundFieldAccess(SyntaxNode syntax, BoundExpression receiverOpt, FieldSym
this
.
ConstantValueOpt
=
constantValueOpt
;
this
.
_ResultKind
=
resultKind
;
this
.
IsByValue
=
isByValue
;
this
.
IsDeclaration
=
isDeclaration
;
}
...
...
@@ -5289,16 +5290,18 @@ public BoundFieldAccess(SyntaxNode syntax, BoundExpression receiverOpt, FieldSym
public
bool
IsByValue
{
get
;
}
public
bool
IsDeclaration
{
get
;
}
public
override
BoundNode
Accept
(
BoundTreeVisitor
visitor
)
{
return
visitor
.
VisitFieldAccess
(
this
);
}
public
BoundFieldAccess
Update
(
BoundExpression
receiverOpt
,
FieldSymbol
fieldSymbol
,
ConstantValue
constantValueOpt
,
LookupResultKind
resultKind
,
bool
isByValue
,
TypeSymbol
type
)
public
BoundFieldAccess
Update
(
BoundExpression
receiverOpt
,
FieldSymbol
fieldSymbol
,
ConstantValue
constantValueOpt
,
LookupResultKind
resultKind
,
bool
isByValue
,
bool
isDeclaration
,
TypeSymbol
type
)
{
if
(
receiverOpt
!=
this
.
ReceiverOpt
||
fieldSymbol
!=
this
.
FieldSymbol
||
constantValueOpt
!=
this
.
ConstantValueOpt
||
resultKind
!=
this
.
ResultKind
||
isByValue
!=
this
.
IsByValue
||
type
!=
this
.
Type
)
if
(
receiverOpt
!=
this
.
ReceiverOpt
||
fieldSymbol
!=
this
.
FieldSymbol
||
constantValueOpt
!=
this
.
ConstantValueOpt
||
resultKind
!=
this
.
ResultKind
||
isByValue
!=
this
.
IsByValue
||
isDeclaration
!=
this
.
IsDeclaration
||
type
!=
this
.
Type
)
{
var
result
=
new
BoundFieldAccess
(
this
.
Syntax
,
receiverOpt
,
fieldSymbol
,
constantValueOpt
,
resultKind
,
isByValue
,
type
,
this
.
HasErrors
);
var
result
=
new
BoundFieldAccess
(
this
.
Syntax
,
receiverOpt
,
fieldSymbol
,
constantValueOpt
,
resultKind
,
isByValue
,
isDeclaration
,
type
,
this
.
HasErrors
);
result
.
WasCompilerGenerated
=
this
.
WasCompilerGenerated
;
return
result
;
}
...
...
@@ -9119,7 +9122,7 @@ public override BoundNode VisitFieldAccess(BoundFieldAccess node)
{
BoundExpression
receiverOpt
=
(
BoundExpression
)
this
.
Visit
(
node
.
ReceiverOpt
);
TypeSymbol
type
=
this
.
VisitType
(
node
.
Type
);
return
node
.
Update
(
receiverOpt
,
node
.
FieldSymbol
,
node
.
ConstantValueOpt
,
node
.
ResultKind
,
node
.
IsByValue
,
type
);
return
node
.
Update
(
receiverOpt
,
node
.
FieldSymbol
,
node
.
ConstantValueOpt
,
node
.
ResultKind
,
node
.
IsByValue
,
node
.
IsDeclaration
,
type
);
}
public
override
BoundNode
VisitHoistedFieldAccess
(
BoundHoistedFieldAccess
node
)
{
...
...
@@ -10578,6 +10581,7 @@ public override TreeDumperNode VisitFieldAccess(BoundFieldAccess node, object ar
new
TreeDumperNode
(
"constantValueOpt"
,
node
.
ConstantValueOpt
,
null
),
new
TreeDumperNode
(
"resultKind"
,
node
.
ResultKind
,
null
),
new
TreeDumperNode
(
"isByValue"
,
node
.
IsByValue
,
null
),
new
TreeDumperNode
(
"isDeclaration"
,
node
.
IsDeclaration
,
null
),
new
TreeDumperNode
(
"type"
,
node
.
Type
,
null
)
}
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录