Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
976fec51
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,发现更多精彩内容 >>
提交
976fec51
编写于
10月 27, 2016
作者:
C
CyrusNajmabadi
提交者:
GitHub
10月 27, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14764 from CyrusNajmabadi/formatFile
Fix casing issues in SemanticModel.vb
上级
cc7e706a
d621e50b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
28 deletion
+28
-28
src/Compilers/VisualBasic/Portable/Compilation/SemanticModel.vb
...mpilers/VisualBasic/Portable/Compilation/SemanticModel.vb
+28
-28
未找到文件。
src/Compilers/VisualBasic/Portable/Compilation/SemanticModel.vb
浏览文件 @
976fec51
...
...
@@ -353,7 +353,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
' Determine the type, converted type, and expression
Dim
type
As
TypeSymbol
=
Nothing
Dim
convertedType
As
TypeSymbol
=
Nothing
Dim
conversion
As
c
onversion
=
Nothing
Dim
conversion
As
C
onversion
=
Nothing
type
=
GetSemanticType
(
boundNodes
,
convertedType
,
conversion
)
Return
New
VisualBasicTypeInfo
(
type
,
convertedType
,
conversion
)
...
...
@@ -792,7 +792,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
' Convert a stand-alone speculatively bound expression to an rvalue.
' This will get the value of properties, convert lambdas to anonymous
' delegate type, etc.
Dim
boundExpression
=
TryCast
(
node
,
b
oundExpression
)
Dim
boundExpression
=
TryCast
(
node
,
B
oundExpression
)
If
boundExpression
IsNot
Nothing
Then
' Try calling ReclassifyAsValue
Dim
diagnostics
=
DiagnosticBag
.
GetInstance
()
...
...
@@ -920,7 +920,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
ByRef
convertedType
As
TypeSymbol
,
ByRef
conversion
As
Conversion
)
As
TypeSymbol
convertedType
=
Nothing
conversion
=
New
c
onversion
(
Conversions
.
Identity
)
conversion
=
New
C
onversion
(
Conversions
.
Identity
)
Dim
lowestExpr
=
TryCast
(
boundNodes
.
LowestBoundNode
,
BoundExpression
)
Dim
highestExpr
=
TryCast
(
boundNodes
.
HighestBoundNode
,
BoundExpression
)
...
...
@@ -972,7 +972,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
' be a higher conversion node associated to the same syntax node.
If
highestExpr
IsNot
Nothing
Then
If
highestExpr
.
Type
IsNot
Nothing
AndAlso
highestExpr
.
Type
.
TypeKind
<>
T
YPEKIND
.
Error
Then
If
highestExpr
.
Type
IsNot
Nothing
AndAlso
highestExpr
.
Type
.
TypeKind
<>
T
ypeKind
.
Error
Then
convertedType
=
highestExpr
.
Type
If
(
type
Is
Nothing
OrElse
Not
type
.
IsSameTypeIgnoringAll
(
convertedType
))
Then
' If the upper expression is of a different type, we want to return
...
...
@@ -982,9 +982,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Dim
conversionNode
=
DirectCast
(
highestExpr
,
BoundConversion
)
If
useOfLocalBeforeDeclaration
AndAlso
Not
type
.
IsErrorType
()
Then
conversion
=
New
c
onversion
(
Conversions
.
ClassifyConversion
(
type
,
convertedType
,
Nothing
))
conversion
=
New
C
onversion
(
Conversions
.
ClassifyConversion
(
type
,
convertedType
,
Nothing
))
Else
conversion
=
New
c
onversion
(
KeyValuePair
.
Create
(
conversionNode
.
ConversionKind
,
conversion
=
New
C
onversion
(
KeyValuePair
.
Create
(
conversionNode
.
ConversionKind
,
TryCast
(
conversionNode
.
ExpressionSymbol
,
MethodSymbol
)))
End
If
End
If
...
...
@@ -1052,7 +1052,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
If
boundType
.
AliasOpt
IsNot
Nothing
Then
symbolsBuilder
.
Add
(
boundType
.
AliasOpt
)
Else
Dim
typeSymbol
As
t
ypeSymbol
=
boundType
.
Type
Dim
typeSymbol
As
T
ypeSymbol
=
boundType
.
Type
Dim
originalErrorType
=
TryCast
(
typeSymbol
.
OriginalDefinition
,
ErrorTypeSymbol
)
If
originalErrorType
IsNot
Nothing
Then
resultKind
=
originalErrorType
.
ResultKind
...
...
@@ -1120,7 +1120,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
BoundKind
.
MyClassReference
Dim
meReference
=
DirectCast
(
boundNodes
.
LowestBoundNode
,
BoundExpression
)
Dim
binder
As
b
inder
=
If
(
binderOpt
,
GetEnclosingBinder
(
boundNodes
.
LowestBoundNode
.
Syntax
.
SpanStart
))
Dim
binder
As
B
inder
=
If
(
binderOpt
,
GetEnclosingBinder
(
boundNodes
.
LowestBoundNode
.
Syntax
.
SpanStart
))
Dim
containingType
As
NamedTypeSymbol
=
binder
.
ContainingType
Dim
containingMember
=
binder
.
ContainingMember
...
...
@@ -1443,13 +1443,13 @@ _Default:
' We must have bound to a single named type
If
unwrappedSymbols
.
Length
=
1
AndAlso
TypeOf
unwrappedSymbols
(
0
)
Is
TypeSymbol
Then
Dim
typeSymbol
As
typeSymbol
=
DirectCast
(
unwrappedSymbols
(
0
),
t
ypeSymbol
)
Dim
namedTypeSymbol
As
namedTypeSymbol
=
TryCast
(
typeSymbol
,
n
amedTypeSymbol
)
Dim
typeSymbol
As
TypeSymbol
=
DirectCast
(
unwrappedSymbols
(
0
),
T
ypeSymbol
)
Dim
namedTypeSymbol
As
NamedTypeSymbol
=
TryCast
(
typeSymbol
,
N
amedTypeSymbol
)
' Figure out which constructor was selected.
Select
Case
boundNodeOfSyntacticParent
.
Kind
Case
BoundKind
.
Attribute
Dim
boundAttribute
As
boundAttribute
=
DirectCast
(
boundNodeOfSyntacticParent
,
b
oundAttribute
)
Dim
boundAttribute
As
BoundAttribute
=
DirectCast
(
boundNodeOfSyntacticParent
,
B
oundAttribute
)
Debug
.
Assert
(
resultKind
<>
LookupResultKind
.
Good
OrElse
namedTypeSymbol
=
boundAttribute
.
Type
)
constructor
=
boundAttribute
.
Constructor
...
...
@@ -1457,7 +1457,7 @@ _Default:
Case
BoundKind
.
BadExpression
' Note that namedTypeSymbol might be null here; e.g., a type parameter.
Dim
boundBadExpression
As
boundBadExpression
=
DirectCast
(
boundNodeOfSyntacticParent
,
b
oundBadExpression
)
Dim
boundBadExpression
As
BoundBadExpression
=
DirectCast
(
boundNodeOfSyntacticParent
,
B
oundBadExpression
)
resultKind
=
LookupResult
.
WorseResultKind
(
resultKind
,
boundBadExpression
.
ResultKind
)
Case
Else
...
...
@@ -1488,12 +1488,12 @@ _Default:
' Filter namedTypeSymbol's instance constructors by accessibility.
' If all the instance constructors are inaccessible, we retain
' all the instance constructors.
Dim
binder
As
b
inder
=
If
(
binderOpt
,
GetEnclosingBinder
(
lowestBoundNode
.
Syntax
.
SpanStart
))
Dim
binder
As
B
inder
=
If
(
binderOpt
,
GetEnclosingBinder
(
lowestBoundNode
.
Syntax
.
SpanStart
))
Dim
candidateConstructors
As
ImmutableArray
(
Of
MethodSymbol
)
If
binder
IsNot
Nothing
Then
Dim
interfaceCoClass
As
n
amedTypeSymbol
=
If
(
namedTypeSymbol
.
IsInterface
,
TryCast
(
namedTypeSymbol
.
CoClassType
,
n
amedTypeSymbol
),
Nothing
)
Dim
interfaceCoClass
As
N
amedTypeSymbol
=
If
(
namedTypeSymbol
.
IsInterface
,
TryCast
(
namedTypeSymbol
.
CoClassType
,
N
amedTypeSymbol
),
Nothing
)
candidateConstructors
=
binder
.
GetAccessibleConstructors
(
If
(
interfaceCoClass
,
namedTypeSymbol
),
useSiteDiagnostics
:
=
Nothing
)
Dim
instanceConstructors
=
namedTypeSymbol
.
InstanceConstructors
...
...
@@ -1533,7 +1533,7 @@ _Default:
' Getting the set of symbols is a bit involved. We use the union of the symbol with
' any symbols from the diagnostics, but error symbols are not included.\
Dim
resultKind
As
LookupResultKind
Dim
symbolsBuilder
=
ArrayBuilder
(
Of
s
ymbol
).
GetInstance
()
Dim
symbolsBuilder
=
ArrayBuilder
(
Of
S
ymbol
).
GetInstance
()
Dim
originalErrorSymbol
=
If
(
type
IsNot
Nothing
,
TryCast
(
type
.
OriginalDefinition
,
ErrorTypeSymbol
),
Nothing
)
If
originalErrorSymbol
IsNot
Nothing
Then
' Error case.
...
...
@@ -1550,7 +1550,7 @@ _Default:
resultKind
=
LookupResultKind
.
Good
End
If
Dim
symbols
As
ImmutableArray
(
Of
s
ymbol
)
=
RemoveErrorTypesAndDuplicates
(
symbolsBuilder
,
options
)
Dim
symbols
As
ImmutableArray
(
Of
S
ymbol
)
=
RemoveErrorTypesAndDuplicates
(
symbolsBuilder
,
options
)
symbolsBuilder
.
Free
()
Return
SymbolInfoFactory
.
Create
(
symbols
,
resultKind
)
...
...
@@ -2080,7 +2080,7 @@ _Default:
Throw
New
ArgumentNullException
(
NameOf
(
symbol
))
End
If
Dim
vbsymbol
=
symbol
.
EnsureVbSymbolOrNothing
(
Of
s
ymbol
)(
NameOf
(
symbol
))
Dim
vbsymbol
=
symbol
.
EnsureVbSymbolOrNothing
(
Of
S
ymbol
)(
NameOf
(
symbol
))
Dim
binder
=
Me
.
GetEnclosingBinder
(
position
)
If
binder
IsNot
Nothing
Then
...
...
@@ -2259,7 +2259,7 @@ _Default:
CheckPosition
(
position
)
CheckModelAndSyntaxNodeToSpeculate
(
attribute
)
Dim
binder
As
b
inder
=
Me
.
GetSpeculativeAttributeBinder
(
position
,
attribute
)
Dim
binder
As
B
inder
=
Me
.
GetSpeculativeAttributeBinder
(
position
,
attribute
)
If
binder
Is
Nothing
Then
speculativeModel
=
Nothing
Return
False
...
...
@@ -2368,11 +2368,11 @@ _Default:
Throw
New
ArgumentException
(
VBResources
.
IdentifierSyntaxNotWithinSyntaxTree
)
End
If
Dim
binder
As
b
inder
=
Me
.
GetEnclosingBinder
(
identifierSyntax
.
SpanStart
)
Dim
binder
As
B
inder
=
Me
.
GetEnclosingBinder
(
identifierSyntax
.
SpanStart
)
Dim
blockBinder
=
TryCast
(
StripSemanticModelBinder
(
binder
),
BlockBaseBinder
)
If
blockBinder
IsNot
Nothing
Then
' Most of the time, we should be able to find the identifier by name.
Dim
lookupResult
As
lookupResult
=
l
ookupResult
.
GetInstance
()
Dim
lookupResult
As
LookupResult
=
L
ookupResult
.
GetInstance
()
Try
' NB: "binder", not "blockBinder", so that we don't incorrectly mark imports as used.
binder
.
Lookup
(
lookupResult
,
identifierSyntax
.
Identifier
.
ValueText
,
0
,
Nothing
,
useSiteDiagnostics
:
=
Nothing
)
...
...
@@ -3047,12 +3047,12 @@ _Default:
Throw
New
ArgumentNullException
(
NameOf
(
node
))
End
If
Dim
expressionSyntax
=
TryCast
(
node
,
e
xpressionSyntax
)
Dim
expressionSyntax
=
TryCast
(
node
,
E
xpressionSyntax
)
If
expressionSyntax
IsNot
Nothing
Then
Return
Me
.
GetSymbolInfo
(
expressionSyntax
,
cancellationToken
)
End
If
Dim
attributeSyntax
=
TryCast
(
node
,
a
ttributeSyntax
)
Dim
attributeSyntax
=
TryCast
(
node
,
A
ttributeSyntax
)
If
attributeSyntax
IsNot
Nothing
Then
Return
Me
.
GetSymbolInfo
(
attributeSyntax
,
cancellationToken
)
End
If
...
...
@@ -3090,12 +3090,12 @@ _Default:
Throw
New
ArgumentNullException
(
NameOf
(
node
))
End
If
Dim
expressionSyntax
=
TryCast
(
node
,
e
xpressionSyntax
)
Dim
expressionSyntax
=
TryCast
(
node
,
E
xpressionSyntax
)
If
expressionSyntax
IsNot
Nothing
Then
Return
Me
.
GetTypeInfoWorker
(
expressionSyntax
,
cancellationToken
)
End
If
Dim
attributeSyntax
=
TryCast
(
node
,
a
ttributeSyntax
)
Dim
attributeSyntax
=
TryCast
(
node
,
A
ttributeSyntax
)
If
attributeSyntax
IsNot
Nothing
Then
Return
Me
.
GetTypeInfoWorker
(
attributeSyntax
,
cancellationToken
)
End
If
...
...
@@ -3108,12 +3108,12 @@ _Default:
Throw
New
ArgumentNullException
(
NameOf
(
node
))
End
If
Dim
expressionSyntax
=
TryCast
(
node
,
e
xpressionSyntax
)
Dim
expressionSyntax
=
TryCast
(
node
,
E
xpressionSyntax
)
If
expressionSyntax
IsNot
Nothing
Then
Return
Me
.
GetMemberGroup
(
expressionSyntax
,
cancellationToken
)
End
If
Dim
attributeSyntax
=
TryCast
(
node
,
a
ttributeSyntax
)
Dim
attributeSyntax
=
TryCast
(
node
,
A
ttributeSyntax
)
If
attributeSyntax
IsNot
Nothing
Then
Return
Me
.
GetMemberGroup
(
attributeSyntax
,
cancellationToken
)
End
If
...
...
@@ -3393,7 +3393,7 @@ _Default:
End
Function
Protected
NotOverridable
Overrides
Function
IsAccessibleCore
(
position
As
Integer
,
symbol
As
ISymbol
)
As
Boolean
Return
Me
.
IsAccessible
(
position
,
symbol
.
EnsureVbSymbolOrNothing
(
Of
s
ymbol
)(
NameOf
(
symbol
)))
Return
Me
.
IsAccessible
(
position
,
symbol
.
EnsureVbSymbolOrNothing
(
Of
S
ymbol
)(
NameOf
(
symbol
)))
End
Function
Protected
NotOverridable
Overrides
Function
IsEventUsableAsFieldCore
(
position
As
Integer
,
symbol
As
IEventSymbol
)
As
Boolean
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录