Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
9346619f
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,发现更多精彩内容 >>
提交
9346619f
编写于
3月 03, 2015
作者:
T
Tomas Matousek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename BitArray to BitVector to avoid conflict with System.Collections.BitArray
上级
8bbe2203
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
94 addition
and
95 deletion
+94
-95
src/Compilers/CSharp/Portable/FlowAnalysis/DataFlowPass.cs
src/Compilers/CSharp/Portable/FlowAnalysis/DataFlowPass.cs
+7
-7
src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LoweredDynamicOperationFactory.cs
.../Lowering/LocalRewriter/LoweredDynamicOperationFactory.cs
+3
-3
src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/AnonymousTypeManager.Templates.cs
.../Symbols/AnonymousTypes/AnonymousTypeManager.Templates.cs
+3
-3
src/Compilers/CSharp/Portable/Symbols/ConstraintsHelper.cs
src/Compilers/CSharp/Portable/Symbols/ConstraintsHelper.cs
+3
-3
src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedDelegateSymbol.cs
...Portable/Symbols/Synthesized/SynthesizedDelegateSymbol.cs
+2
-2
src/Compilers/Core/CodeAnalysisTest/Collections/BitArrayTests.cs
...pilers/Core/CodeAnalysisTest/Collections/BitArrayTests.cs
+6
-6
src/Compilers/Core/Portable/CodeAnalysis.csproj
src/Compilers/Core/Portable/CodeAnalysis.csproj
+1
-1
src/Compilers/Core/Portable/Collections/BitVector.cs
src/Compilers/Core/Portable/Collections/BitVector.cs
+16
-17
src/Compilers/VisualBasic/Portable/Analysis/FlowAnalysis/DataFlowPass.LocalState.vb
...Portable/Analysis/FlowAnalysis/DataFlowPass.LocalState.vb
+6
-6
src/Compilers/VisualBasic/Portable/Analysis/FlowAnalysis/DataFlowPass.vb
...isualBasic/Portable/Analysis/FlowAnalysis/DataFlowPass.vb
+6
-6
src/Compilers/VisualBasic/Portable/Binding/Binder_Lambda.vb
src/Compilers/VisualBasic/Portable/Binding/Binder_Lambda.vb
+1
-1
src/Compilers/VisualBasic/Portable/BoundTree/UnboundLambda.vb
...Compilers/VisualBasic/Portable/BoundTree/UnboundLambda.vb
+4
-4
src/Compilers/VisualBasic/Portable/Semantics/Operators.vb
src/Compilers/VisualBasic/Portable/Semantics/Operators.vb
+6
-6
src/Compilers/VisualBasic/Portable/Semantics/OverloadResolution.vb
...lers/VisualBasic/Portable/Semantics/OverloadResolution.vb
+15
-15
src/Compilers/VisualBasic/Portable/Semantics/TypeInference/TypeArgumentInference.vb
...Portable/Semantics/TypeInference/TypeArgumentInference.vb
+11
-11
src/Compilers/VisualBasic/Portable/Symbols/ReducedExtensionMethodSymbol.vb
...ualBasic/Portable/Symbols/ReducedExtensionMethodSymbol.vb
+1
-1
src/Compilers/VisualBasic/Portable/Symbols/TypeSubstitution.vb
...ompilers/VisualBasic/Portable/Symbols/TypeSubstitution.vb
+3
-3
未找到文件。
src/Compilers/CSharp/Portable/FlowAnalysis/DataFlowPass.cs
浏览文件 @
9346619f
...
...
@@ -77,7 +77,7 @@ internal partial class DataFlowPass : AbstractFlowPass<DataFlowPass.LocalState>
/// Tracks variables for which we have already reported a definite assignment error. This
/// allows us to report at most one such error per variable.
/// </summary>
private
Bit
Array
_alreadyReported
;
private
Bit
Vector
_alreadyReported
;
/// <summary>
/// Reflects the enclosing method or lambda at the current location (in the bound tree).
...
...
@@ -174,7 +174,7 @@ protected override ImmutableArray<PendingBranch> Scan(ref bool badRegion)
this
.
Diagnostics
.
Clear
();
ImmutableArray
<
ParameterSymbol
>
methodParameters
=
MethodParameters
;
ParameterSymbol
methodThisParameter
=
MethodThisParameter
;
_alreadyReported
=
Bit
Array
.
Empty
;
// no variables yet reported unassigned
_alreadyReported
=
Bit
Vector
.
Empty
;
// no variables yet reported unassigned
this
.
State
=
ReachableState
();
// entry point is reachable
this
.
regionPlace
=
RegionPlace
.
Before
;
EnterParameters
(
methodParameters
);
// with parameters assigned
...
...
@@ -1171,12 +1171,12 @@ private void SetSlotUnassigned(int slot)
protected
override
LocalState
ReachableState
()
{
return
new
LocalState
(
Bit
Array
.
Empty
);
return
new
LocalState
(
Bit
Vector
.
Empty
);
}
protected
override
LocalState
AllBitsSet
()
{
var
result
=
new
LocalState
(
Bit
Array
.
AllSet
(
nextVariableSlot
));
var
result
=
new
LocalState
(
Bit
Vector
.
AllSet
(
nextVariableSlot
));
result
.
Assigned
[
0
]
=
false
;
return
result
;
}
...
...
@@ -1878,7 +1878,7 @@ protected override string Dump(LocalState state)
return
builder
.
ToString
();
}
protected
void
AppendBitNames
(
Bit
Array
a
,
StringBuilder
builder
)
protected
void
AppendBitNames
(
Bit
Vector
a
,
StringBuilder
builder
)
{
bool
any
=
false
;
foreach
(
int
bit
in
a
.
TrueBits
())
...
...
@@ -1948,9 +1948,9 @@ protected override bool IntersectWith(ref LocalState self, ref LocalState other)
internal
struct
LocalState
:
AbstractLocalState
{
internal
Bit
Array
Assigned
;
internal
Bit
Vector
Assigned
;
internal
LocalState
(
Bit
Array
assigned
)
internal
LocalState
(
Bit
Vector
assigned
)
{
this
.
Assigned
=
assigned
;
Debug
.
Assert
(!
assigned
.
IsNull
);
...
...
src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LoweredDynamicOperationFactory.cs
浏览文件 @
9346619f
...
...
@@ -726,10 +726,10 @@ internal FieldSymbol DefineCallSiteStorageSymbol(NamedTypeSymbol containerDefini
}
}
Bit
Array
byRefs
;
Bit
Vector
byRefs
;
if
(
hasByRefs
)
{
byRefs
=
Bit
Array
.
Create
(
1
+
(
loweredReceiver
!=
null
?
1
:
0
)
+
loweredArguments
.
Length
+
(
loweredRight
!=
null
?
1
:
0
));
byRefs
=
Bit
Vector
.
Create
(
1
+
(
loweredReceiver
!=
null
?
1
:
0
)
+
loweredArguments
.
Length
+
(
loweredRight
!=
null
?
1
:
0
));
int
j
=
1
;
if
(
loweredReceiver
!=
null
)
...
...
@@ -750,7 +750,7 @@ internal FieldSymbol DefineCallSiteStorageSymbol(NamedTypeSymbol containerDefini
}
else
{
byRefs
=
default
(
Bit
Array
);
byRefs
=
default
(
Bit
Vector
);
}
int
parameterCount
=
delegateSignature
.
Length
-
(
returnsVoid
?
0
:
1
);
...
...
src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/AnonymousTypeManager.Templates.cs
浏览文件 @
9346619f
...
...
@@ -35,11 +35,11 @@ internal sealed partial class AnonymousTypeManager
private
struct
SynthesizedDelegateKey
:
IEquatable
<
SynthesizedDelegateKey
>
{
private
readonly
Bit
Array
_byRefs
;
private
readonly
Bit
Vector
_byRefs
;
private
readonly
ushort
_parameterCount
;
private
readonly
byte
_returnsVoid
;
public
SynthesizedDelegateKey
(
int
parameterCount
,
Bit
Array
byRefs
,
bool
returnsVoid
)
public
SynthesizedDelegateKey
(
int
parameterCount
,
Bit
Vector
byRefs
,
bool
returnsVoid
)
{
_parameterCount
=
(
ushort
)
parameterCount
;
_returnsVoid
=
(
byte
)(
returnsVoid
?
1
:
0
);
...
...
@@ -182,7 +182,7 @@ private void CheckSourceLocationSeen(AnonymousTypePublicSymbol anonymous)
}
}
internal
SynthesizedDelegateSymbol
SynthesizeDelegate
(
int
parameterCount
,
Bit
Array
byRefParameters
,
bool
returnsVoid
)
internal
SynthesizedDelegateSymbol
SynthesizeDelegate
(
int
parameterCount
,
Bit
Vector
byRefParameters
,
bool
returnsVoid
)
{
// parameterCount doesn't include return type
Debug
.
Assert
(
byRefParameters
.
IsNull
||
parameterCount
==
byRefParameters
.
Capacity
);
...
...
src/Compilers/CSharp/Portable/Symbols/ConstraintsHelper.cs
浏览文件 @
9346619f
...
...
@@ -484,7 +484,7 @@ private static bool InterfacesAreDistinct(NamedTypeSymbol type, ConsList<Symbol>
CSharpSyntaxNode
syntaxNode
,
Compilation
currentCompilation
,
DiagnosticBag
diagnostics
,
Bit
Array
skipParameters
=
default
(
BitArray
))
Bit
Vector
skipParameters
=
default
(
BitVector
))
{
if
(!
RequiresChecking
(
method
))
{
...
...
@@ -564,7 +564,7 @@ private static bool InterfacesAreDistinct(NamedTypeSymbol type, ConsList<Symbol>
Compilation
currentCompilation
,
ArrayBuilder
<
TypeParameterDiagnosticInfo
>
diagnosticsBuilder
,
ref
ArrayBuilder
<
TypeParameterDiagnosticInfo
>
useSiteDiagnosticsBuilder
,
Bit
Array
skipParameters
=
default
(
BitArray
))
Bit
Vector
skipParameters
=
default
(
BitVector
))
{
return
CheckConstraints
(
method
,
...
...
@@ -600,7 +600,7 @@ private static bool InterfacesAreDistinct(NamedTypeSymbol type, ConsList<Symbol>
Compilation
currentCompilation
,
ArrayBuilder
<
TypeParameterDiagnosticInfo
>
diagnosticsBuilder
,
ref
ArrayBuilder
<
TypeParameterDiagnosticInfo
>
useSiteDiagnosticsBuilder
,
Bit
Array
skipParameters
=
default
(
BitArray
))
Bit
Vector
skipParameters
=
default
(
BitVector
))
{
Debug
.
Assert
(
typeParameters
.
Length
==
typeArguments
.
Length
);
Debug
.
Assert
(
typeParameters
.
Length
>
0
);
...
...
src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedDelegateSymbol.cs
浏览文件 @
9346619f
...
...
@@ -22,7 +22,7 @@ internal sealed class SynthesizedDelegateSymbol : SynthesizedContainer
TypeSymbol
intPtrType
,
TypeSymbol
voidReturnTypeOpt
,
int
parameterCount
,
Bit
Array
byRefParameters
)
Bit
Vector
byRefParameters
)
:
base
(
name
,
parameterCount
,
returnsVoid
:
(
object
)
voidReturnTypeOpt
!=
null
)
{
_containingSymbol
=
containingSymbol
;
...
...
@@ -102,7 +102,7 @@ private sealed class InvokeMethod : SynthesizedInstanceMethodSymbol
private
readonly
TypeSymbol
_containingType
;
private
readonly
TypeSymbol
_returnType
;
internal
InvokeMethod
(
SynthesizedDelegateSymbol
containingType
,
Bit
Array
byRefParameters
,
TypeSymbol
voidReturnTypeOpt
)
internal
InvokeMethod
(
SynthesizedDelegateSymbol
containingType
,
Bit
Vector
byRefParameters
,
TypeSymbol
voidReturnTypeOpt
)
{
var
typeParams
=
containingType
.
TypeParameters
;
...
...
src/Compilers/Core/CodeAnalysisTest/Collections/BitArrayTests.cs
浏览文件 @
9346619f
...
...
@@ -22,9 +22,9 @@ public void UpperBitsUnset()
{
for
(
int
b
=
-
1
;
b
<
2
;
b
++)
// number of bits more or less than that number of words
{
int
n
=
Bit
Array
.
BitsPerWord
*
a
+
b
;
int
n
=
Bit
Vector
.
BitsPerWord
*
a
+
b
;
if
(
n
<
0
)
continue
;
Bit
Array
arr
=
BitArray
.
AllSet
(
n
);
Bit
Vector
arr
=
BitVector
.
AllSet
(
n
);
if
(
n
>
0
)
Assert
.
True
(
arr
[
n
-
1
]);
Assert
.
False
(
arr
[
n
]);
}
...
...
@@ -50,7 +50,7 @@ public void CheckRandomData()
private
void
CheckRandomDataCore
(
Random
r1
,
Random
r2
,
int
capacity
)
{
Bit
Array
d
=
BitArray
.
Create
(
capacity
);
Bit
Vector
d
=
BitVector
.
Create
(
capacity
);
Assert
.
Equal
(
capacity
,
d
.
Capacity
);
for
(
int
i1
=
0
;
i1
<
capacity
;
i1
++)
d
[
i1
]
=
r1
.
NextBool
();
...
...
@@ -74,7 +74,7 @@ public void CheckIntersection()
private
void
CheckIntersectionCore
(
int
capacity
,
Random
r
)
{
Bit
Array
b1
=
BitArray
.
Empty
,
b2
=
BitArray
.
Empty
;
Bit
Vector
b1
=
BitVector
.
Empty
,
b2
=
BitVector
.
Empty
;
b1
.
EnsureCapacity
(
capacity
);
b2
.
EnsureCapacity
(
capacity
);
bool
[]
a1
=
new
bool
[
capacity
],
a2
=
new
bool
[
capacity
];
...
...
@@ -112,7 +112,7 @@ public void CheckUnion()
private
void
CheckUnionCore
(
int
capacity
,
Random
r
)
{
Bit
Array
b1
=
BitArray
.
Empty
,
b2
=
BitArray
.
Empty
;
Bit
Vector
b1
=
BitVector
.
Empty
,
b2
=
BitVector
.
Empty
;
b1
.
EnsureCapacity
(
capacity
);
b2
.
EnsureCapacity
(
capacity
);
bool
[]
a1
=
new
bool
[
capacity
],
a2
=
new
bool
[
capacity
];
...
...
@@ -151,7 +151,7 @@ public void CheckTrueBits()
private
void
CheckTrueBitsCore
(
int
capacity
,
Random
r1
,
Random
r2
)
{
Bit
Array
b
=
BitArray
.
Create
(
capacity
);
Bit
Vector
b
=
BitVector
.
Create
(
capacity
);
for
(
int
i
=
0
;
i
<
capacity
;
i
++)
{
b
[
i
]
=
r1
.
NextBool
();
...
...
src/Compilers/Core/Portable/CodeAnalysis.csproj
浏览文件 @
9346619f
...
...
@@ -93,7 +93,7 @@
<Compile
Include=
"CodeGen\Win32Res.cs"
/>
<Compile
Include=
"Collections\ArrayBuilderExtensions.cs"
/>
<Compile
Include=
"Collections\ArrayElement.cs"
/>
<Compile
Include=
"Collections\Bit
Array
.cs"
/>
<Compile
Include=
"Collections\Bit
Vector
.cs"
/>
<Compile
Include=
"Collections\Boxes.cs"
/>
<Compile
Include=
"Collections\ByteSequenceComparer.cs"
/>
<Compile
Include=
"Collections\CachingDictionary.cs"
/>
...
...
src/Compilers/Core/Portable/Collections/Bit
Array
.cs
→
src/Compilers/Core/Portable/Collections/Bit
Vector
.cs
浏览文件 @
9346619f
...
...
@@ -3,19 +3,18 @@
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
Microsoft.CodeAnalysis.Text
;
using
Roslyn.Utilities
;
using
Word
=
System
.
UInt32
;
namespace
Microsoft.CodeAnalysis
{
internal
struct
Bit
Array
:
IEquatable
<
BitArray
>
internal
struct
Bit
Vector
:
IEquatable
<
BitVector
>
{
// Cannot expose the following two field publicly because this structure is mutable
// and might become not null/empty, unless we restrict access to it.
private
static
Word
[]
s_emptyArray
=
SpecializedCollections
.
EmptyArray
<
Word
>();
private
static
readonly
Bit
Array
s_nullValue
=
new
BitArray
(
0
,
null
,
0
);
private
static
readonly
Bit
Array
s_emptyValue
=
new
BitArray
(
0
,
s_emptyArray
,
0
);
private
static
readonly
Bit
Vector
s_nullValue
=
new
BitVector
(
0
,
null
,
0
);
private
static
readonly
Bit
Vector
s_emptyValue
=
new
BitVector
(
0
,
s_emptyArray
,
0
);
private
const
int
Log2BitsPerWord
=
5
;
internal
const
int
BitsPerWord
=
1
<<
Log2BitsPerWord
;
...
...
@@ -25,7 +24,7 @@ internal struct BitArray : IEquatable<BitArray>
private
Word
[]
_bits
;
private
int
_capacity
;
private
Bit
Array
(
Word
bits0
,
Word
[]
bits
,
int
capacity
)
private
Bit
Vector
(
Word
bits0
,
Word
[]
bits
,
int
capacity
)
{
int
requiredWords
=
WordsForCapacity
(
capacity
);
Debug
.
Assert
(
requiredWords
==
0
||
requiredWords
<=
bits
.
Length
);
...
...
@@ -35,7 +34,7 @@ private BitArray(Word bits0, Word[] bits, int capacity)
Check
();
}
public
bool
Equals
(
Bit
Array
other
)
public
bool
Equals
(
Bit
Vector
other
)
{
// Bit arrays only equal if their underlying sets are of the same size.
return
_capacity
==
other
.
_capacity
...
...
@@ -45,7 +44,7 @@ public bool Equals(BitArray other)
public
override
bool
Equals
(
object
obj
)
{
return
obj
is
Bit
Array
&&
Equals
((
BitArray
)
obj
);
return
obj
is
Bit
Vector
&&
Equals
((
BitVector
)
obj
);
}
public
override
int
GetHashCode
()
...
...
@@ -146,11 +145,11 @@ public IEnumerable<int> TrueBits()
/// <summary>
/// Create BitArray with at least the specified number of bits.
/// </summary>
public
static
Bit
Array
Create
(
int
capacity
)
public
static
Bit
Vector
Create
(
int
capacity
)
{
int
requiredWords
=
WordsForCapacity
(
capacity
);
Word
[]
bits
=
(
requiredWords
==
0
)
?
s_emptyArray
:
new
Word
[
requiredWords
];
return
new
Bit
Array
(
0
,
bits
,
capacity
);
return
new
Bit
Vector
(
0
,
bits
,
capacity
);
}
/// <summary>
...
...
@@ -158,7 +157,7 @@ public static BitArray Create(int capacity)
/// </summary>
/// <param name="capacity"></param>
/// <returns></returns>
public
static
Bit
Array
AllSet
(
int
capacity
)
public
static
Bit
Vector
AllSet
(
int
capacity
)
{
int
requiredWords
=
WordsForCapacity
(
capacity
);
Word
[]
bits
=
(
requiredWords
==
0
)
?
s_emptyArray
:
new
Word
[
requiredWords
];
...
...
@@ -185,16 +184,16 @@ public static BitArray AllSet(int capacity)
bits
[
lastWord
]
=
~
ZeroWord
;
}
return
new
Bit
Array
(
bits0
,
bits
,
capacity
);
return
new
Bit
Vector
(
bits0
,
bits
,
capacity
);
}
/// <summary>
/// Maky a copy of a bit array.
/// </summary>
/// <returns></returns>
public
Bit
Array
Clone
()
public
Bit
Vector
Clone
()
{
return
new
Bit
Array
(
_bits0
,
(
_bits
==
null
)
?
null
:
(
_bits
.
Length
==
0
)
?
s_emptyArray
:
(
Word
[])
_bits
.
Clone
(),
_capacity
);
return
new
Bit
Vector
(
_bits0
,
(
_bits
==
null
)
?
null
:
(
_bits
.
Length
==
0
)
?
s_emptyArray
:
(
Word
[])
_bits
.
Clone
(),
_capacity
);
}
/// <summary>
...
...
@@ -208,7 +207,7 @@ public bool IsNull
}
}
public
static
Bit
Array
Null
public
static
Bit
Vector
Null
{
get
{
...
...
@@ -216,7 +215,7 @@ public static BitArray Null
}
}
public
static
Bit
Array
Empty
public
static
Bit
Vector
Empty
{
get
{
...
...
@@ -229,7 +228,7 @@ public static BitArray Empty
/// For the purposes of the intersection, any bits beyond the current length will be treated as zeroes.
/// Return true if any changes were made to the bits of this bit vector.
/// </summary>
public
bool
IntersectWith
(
Bit
Array
other
)
public
bool
IntersectWith
(
Bit
Vector
other
)
{
bool
anyChanged
=
false
;
int
otherLength
=
other
.
_bits
.
Length
;
...
...
@@ -279,7 +278,7 @@ public bool IntersectWith(BitArray other)
/// Modify this bit vector by '|'ing each element with the other bit vector.
/// </summary>
/// <param name="other"></param>
public
void
UnionWith
(
Bit
Array
other
)
public
void
UnionWith
(
Bit
Vector
other
)
{
int
l
=
other
.
_bits
.
Length
;
if
(
l
>
_bits
.
Length
)
...
...
src/Compilers/VisualBasic/Portable/Analysis/FlowAnalysis/DataFlowPass.LocalState.vb
浏览文件 @
9346619f
...
...
@@ -45,9 +45,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Next
End
Sub
Private
Shared
ReadOnly
Property
UnreachableBitsSet
As
Bit
Array
Private
Shared
ReadOnly
Property
UnreachableBitsSet
As
Bit
Vector
Get
Return
Bit
Array
.
AllSet
(
1
)
Return
Bit
Vector
.
AllSet
(
1
)
End
Get
End
Property
...
...
@@ -55,7 +55,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
''' Intersect bit arrays taking into account 'all bits set' flag
''' </summary>
''' <remarks>receiver will be changed as a result</remarks>
Private
Shared
Function
IntersectBitArrays
(
ByRef
receiver
As
Bit
Array
,
other
As
BitArray
)
As
Boolean
Private
Shared
Function
IntersectBitArrays
(
ByRef
receiver
As
Bit
Vector
,
other
As
BitVector
)
As
Boolean
' NOTE: a state with 'unreachable' slot set to 'assigned' means 'all bits are set'
If
other
(
SlotKind
.
Unreachable
)
Then
' OTHER state has 'all bits set', thus, RECEIVER does not need to be changed
...
...
@@ -76,7 +76,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
''' Union bit arrays taking into account 'all bits set' flag
''' </summary>
''' <remarks>receiver will be changed as a result</remarks>
Private
Shared
Sub
UnionBitArrays
(
ByRef
receiver
As
Bit
Array
,
other
As
BitArray
)
Private
Shared
Sub
UnionBitArrays
(
ByRef
receiver
As
Bit
Vector
,
other
As
BitVector
)
' NOTE: a state with 'unreachable' slot set to 'assigned' means 'all bits are set'
If
receiver
(
SlotKind
.
Unreachable
)
Then
' RECEIVER state has 'all bits set', thus, it does not need to be changed
...
...
@@ -105,9 +105,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Friend
Structure
LocalState
Implements
AbstractLocalState
Friend
Assigned
As
Bit
Array
Friend
Assigned
As
Bit
Vector
Friend
Sub
New
(
assigned
As
Bit
Array
)
Friend
Sub
New
(
assigned
As
Bit
Vector
)
Debug
.
Assert
(
Not
assigned
.
IsNull
)
Me
.
Assigned
=
assigned
End
Sub
...
...
src/Compilers/VisualBasic/Portable/Analysis/FlowAnalysis/DataFlowPass.vb
浏览文件 @
9346619f
...
...
@@ -75,7 +75,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
''' Tracks variables for which we have already reported a definite assignment error. This
''' allows us to report at most one such error per variable.
''' </summary>
Private
alreadyReported
As
Bit
Array
Private
alreadyReported
As
Bit
Vector
''' <summary>
''' Did we see [On Error] or [Resume] statement? Used to suppress some diagnostics.
...
...
@@ -106,7 +106,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
MakeSlot
(
parameter
)
Next
Me
.
alreadyReported
=
Bit
Array
.
Empty
' no variables yet reported unassigned
Me
.
alreadyReported
=
Bit
Vector
.
Empty
' no variables yet reported unassigned
Me
.
EnterParameters
(
MethodParameters
)
' with parameters assigned
Dim
methodMeParameter
=
Me
.
MeParameter
' and with 'Me' assigned as well
If
methodMeParameter
IsNot
Nothing
Then
...
...
@@ -199,7 +199,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End
Sub
Protected
Overrides
Sub
Free
()
Me
.
alreadyReported
=
Bit
Array
.
Null
Me
.
alreadyReported
=
Bit
Vector
.
Null
MyBase
.
Free
()
End
Sub
...
...
@@ -211,7 +211,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Return
builder
.
ToString
()
End
Function
Protected
Sub
AppendBitNames
(
a
As
Bit
Array
,
builder
As
StringBuilder
)
Protected
Sub
AppendBitNames
(
a
As
Bit
Vector
,
builder
As
StringBuilder
)
Dim
any
As
Boolean
=
False
For
Each
bit
In
a
.
TrueBits
If
any
Then
...
...
@@ -1442,7 +1442,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
#End Region
Protected
Overrides
Function
ReachableState
()
As
LocalState
Return
New
LocalState
(
Bit
Array
.
Empty
)
Return
New
LocalState
(
Bit
Vector
.
Empty
)
End
Function
Private
Sub
EnterParameters
(
parameters
As
ImmutableArray
(
Of
ParameterSymbol
))
...
...
@@ -1486,7 +1486,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End
Function
Protected
Overrides
Function
AllBitsSet
()
As
LocalState
Dim
result
=
New
LocalState
(
Bit
Array
.
AllSet
(
nextVariableSlot
))
Dim
result
=
New
LocalState
(
Bit
Vector
.
AllSet
(
nextVariableSlot
))
result
.
Unassign
(
SlotKind
.
Unreachable
)
Return
result
End
Function
...
...
src/Compilers/VisualBasic/Portable/Binding/Binder_Lambda.vb
浏览文件 @
9346619f
...
...
@@ -851,7 +851,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
BindLambdaForErrorRecoveryInferCommonType
(
commonReturnType
,
target
.
ReturnType
)
Next
Dim
isByRef
=
Bit
Array
.
Empty
Dim
isByRef
=
Bit
Vector
.
Empty
For
i
As
Integer
=
0
To
commonParameterTypes
.
Length
-
1
If
source
.
Parameters
(
i
).
Type
IsNot
Nothing
Then
...
...
src/Compilers/VisualBasic/Portable/BoundTree/UnboundLambda.vb
浏览文件 @
9346619f
...
...
@@ -133,9 +133,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Friend
Class
TargetSignature
Public
ReadOnly
ParameterTypes
As
ImmutableArray
(
Of
TypeSymbol
)
Public
ReadOnly
ReturnType
As
TypeSymbol
Private
ReadOnly
m_isByRef
As
Bit
Array
Private
ReadOnly
m_isByRef
As
Bit
Vector
Public
Sub
New
(
parameterTypes
As
ImmutableArray
(
Of
TypeSymbol
),
isByRef
As
Bit
Array
,
returnType
As
TypeSymbol
)
Public
Sub
New
(
parameterTypes
As
ImmutableArray
(
Of
TypeSymbol
),
isByRef
As
Bit
Vector
,
returnType
As
TypeSymbol
)
Debug
.
Assert
(
Not
parameterTypes
.
IsDefault
)
Debug
.
Assert
(
Not
isByRef
.
IsNull
)
Debug
.
Assert
(
returnType
IsNot
Nothing
)
...
...
@@ -148,7 +148,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Debug
.
Assert
(
Not
params
.
IsDefault
)
Debug
.
Assert
(
returnType
IsNot
Nothing
)
Dim
isByRef
=
Bit
Array
.
Empty
Dim
isByRef
=
Bit
Vector
.
Empty
If
params
.
Length
=
0
Then
Me
.
ParameterTypes
=
ImmutableArray
(
Of
TypeSymbol
).
Empty
...
...
@@ -174,7 +174,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Me
.
New
(
method
.
Parameters
,
method
.
ReturnType
)
End
Sub
Public
ReadOnly
Property
IsByRef
As
Bit
Array
Public
ReadOnly
Property
IsByRef
As
Bit
Vector
Get
Return
m_isByRef
End
Get
...
...
src/Compilers/VisualBasic/Portable/Semantics/Operators.vb
浏览文件 @
9346619f
...
...
@@ -1954,7 +1954,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Dim
conversionKinds
=
ArrayBuilder
(
Of
KeyValuePair
(
Of
ConversionKind
,
ConversionKind
)).
GetInstance
()
conversionKinds
.
ZeroInit
(
opSet
.
Count
)
Dim
applicable
=
Bit
Array
.
Create
(
opSet
.
Count
)
Dim
applicable
=
Bit
Vector
.
Create
(
opSet
.
Count
)
Dim
bestMatch
As
MethodSymbol
=
Nothing
If
DetermineMostSpecificWideningConversion
(
source
,
destination
,
opSet
,
conversionKinds
,
applicable
,
bestMatch
,
suppressViabilityChecks
:
=
False
,
useSiteDiagnostics
:
=
useSiteDiagnostics
)
Then
...
...
@@ -2026,7 +2026,7 @@ Done:
destination
As
TypeSymbol
,
opSet
As
ArrayBuilder
(
Of
MethodSymbol
),
conversionKinds
As
ArrayBuilder
(
Of
KeyValuePair
(
Of
ConversionKind
,
ConversionKind
)),
<
[
In
]
()
>
ByRef
applicable
As
Bit
Array
,
<
[
In
]
()
>
ByRef
applicable
As
Bit
Vector
,
<
Out
()
>
ByRef
bestMatch
As
MethodSymbol
,
suppressViabilityChecks
As
Boolean
,
<
[
In
]
,
Out
>
ByRef
useSiteDiagnostics
As
HashSet
(
Of
DiagnosticInfo
)
...
...
@@ -2248,7 +2248,7 @@ Done:
Private
Shared
Function
ChooseMostSpecificConversionOperator
(
opSet
As
ArrayBuilder
(
Of
MethodSymbol
),
applicable
As
Bit
Array
,
applicable
As
Bit
Vector
,
mostSpecificSourceType
As
TypeSymbol
,
mostSpecificTargetType
As
TypeSymbol
,
<
Out
()
>
ByRef
bestMatchIsAmbiguous
As
Boolean
...
...
@@ -2360,7 +2360,7 @@ Done:
destination
As
TypeSymbol
,
opSet
As
ArrayBuilder
(
Of
MethodSymbol
),
conversionKinds
As
ArrayBuilder
(
Of
KeyValuePair
(
Of
ConversionKind
,
ConversionKind
)),
<
[
In
]
()
>
ByRef
applicable
As
Bit
Array
,
<
[
In
]
()
>
ByRef
applicable
As
Bit
Vector
,
<
Out
()
>
ByRef
bestMatch
As
MethodSymbol
,
suppressViabilityChecks
As
Boolean
,
<
[
In
]
,
Out
>
ByRef
useSiteDiagnostics
As
HashSet
(
Of
DiagnosticInfo
)
...
...
@@ -2785,11 +2785,11 @@ Next_i:
Dim
result
As
Integer
=
0
Dim
definition
As
MethodSymbol
=
method
.
OriginalDefinition
If
DetectReferencesToGenericParameters
(
definition
.
Parameters
(
0
).
Type
,
TypeParameterKind
.
Type
,
Bit
Array
.
Null
)
<>
TypeParameterKind
.
None
Then
If
DetectReferencesToGenericParameters
(
definition
.
Parameters
(
0
).
Type
,
TypeParameterKind
.
Type
,
Bit
Vector
.
Null
)
<>
TypeParameterKind
.
None
Then
result
+=
1
End
If
If
DetectReferencesToGenericParameters
(
definition
.
ReturnType
,
TypeParameterKind
.
Type
,
Bit
Array
.
Null
)
<>
TypeParameterKind
.
None
Then
If
DetectReferencesToGenericParameters
(
definition
.
ReturnType
,
TypeParameterKind
.
Type
,
Bit
Vector
.
Null
)
<>
TypeParameterKind
.
None
Then
result
+=
1
End
If
...
...
src/Compilers/VisualBasic/Portable/Semantics/OverloadResolution.vb
浏览文件 @
9346619f
...
...
@@ -69,9 +69,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
''' Extension method type parameters that were fixed during currying, if any.
''' If none were fixed, BitArray.Null should be returned.
''' </summary>
Overridable
ReadOnly
Property
FixedTypeParameters
As
Bit
Array
Overridable
ReadOnly
Property
FixedTypeParameters
As
Bit
Vector
Get
Return
Bit
Array
.
Null
Return
Bit
Vector
.
Null
End
Get
End
Property
...
...
@@ -230,16 +230,16 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Public
NotInheritable
Class
ExtensionMethodCandidate
Inherits
MethodCandidate
Private
m_FixedTypeParameters
As
Bit
Array
Private
m_FixedTypeParameters
As
Bit
Vector
Public
Sub
New
(
method
As
MethodSymbol
)
Me
.
New
(
method
,
GetFixedTypeParameters
(
method
))
End
Sub
' TODO: Consider building this bitmap lazily, on demand.
Private
Shared
Function
GetFixedTypeParameters
(
method
As
MethodSymbol
)
As
Bit
Array
Private
Shared
Function
GetFixedTypeParameters
(
method
As
MethodSymbol
)
As
Bit
Vector
If
method
.
FixedTypeParameters
.
Length
>
0
Then
Dim
fixedTypeParameters
=
Bit
Array
.
Create
(
method
.
ReducedFrom
.
Arity
)
Dim
fixedTypeParameters
=
Bit
Vector
.
Create
(
method
.
ReducedFrom
.
Arity
)
For
Each
fixed
As
KeyValuePair
(
Of
TypeParameterSymbol
,
TypeSymbol
)
In
method
.
FixedTypeParameters
fixedTypeParameters
(
fixed
.
Key
.
Ordinal
)
=
True
...
...
@@ -251,7 +251,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Return
Nothing
End
Function
Private
Sub
New
(
method
As
MethodSymbol
,
fixedTypeParameters
As
Bit
Array
)
Private
Sub
New
(
method
As
MethodSymbol
,
fixedTypeParameters
As
Bit
Vector
)
MyBase
.
New
(
method
)
Debug
.
Assert
(
method
.
ReducedFrom
IsNot
Nothing
)
...
...
@@ -270,7 +270,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End
Get
End
Property
Public
Overrides
ReadOnly
Property
FixedTypeParameters
As
Bit
Array
Public
Overrides
ReadOnly
Property
FixedTypeParameters
As
Bit
Vector
Get
Return
m_FixedTypeParameters
End
Get
...
...
@@ -699,7 +699,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End
Get
End
Property
Public
NotInferredTypeArguments
As
Bit
Array
Public
NotInferredTypeArguments
As
Bit
Vector
Public
TypeArgumentInferenceDiagnosticsOpt
As
DiagnosticBag
...
...
@@ -4597,12 +4597,12 @@ ContinueCandidatesLoop:
' Only interested in method type parameters.
Dim
leftRefersToATypeParameter
=
DetectReferencesToGenericParameters
(
left
.
Candidate
.
ReceiverTypeDefinition
,
TypeParameterKind
.
Method
,
Bit
Array
.
Null
)
Bit
Vector
.
Null
)
' Only interested in method type parameters.
Dim
rightRefersToATypeParameter
=
DetectReferencesToGenericParameters
(
right
.
Candidate
.
ReceiverTypeDefinition
,
TypeParameterKind
.
Method
,
Bit
Array
.
Null
)
Bit
Vector
.
Null
)
If
(
leftRefersToATypeParameter
And
TypeParameterKind
.
Method
)
<>
0
Then
If
(
rightRefersToATypeParameter
And
TypeParameterKind
.
Method
)
=
0
Then
...
...
@@ -4628,7 +4628,7 @@ ContinueCandidatesLoop:
Private
Shared
Function
DetectReferencesToGenericParameters
(
symbol
As
NamedTypeSymbol
,
track
As
TypeParameterKind
,
methodTypeParametersToTreatAsTypeTypeParameters
As
Bit
Array
methodTypeParametersToTreatAsTypeTypeParameters
As
Bit
Vector
)
As
TypeParameterKind
Dim
result
As
TypeParameterKind
=
TypeParameterKind
.
None
...
...
@@ -4661,7 +4661,7 @@ ContinueCandidatesLoop:
Private
Shared
Function
DetectReferencesToGenericParameters
(
symbol
As
TypeParameterSymbol
,
track
As
TypeParameterKind
,
methodTypeParametersToTreatAsTypeTypeParameters
As
Bit
Array
methodTypeParametersToTreatAsTypeTypeParameters
As
Bit
Vector
)
As
TypeParameterKind
If
symbol
.
ContainingSymbol
.
Kind
=
SymbolKind
.
NamedType
Then
...
...
@@ -4686,7 +4686,7 @@ ContinueCandidatesLoop:
Private
Shared
Function
DetectReferencesToGenericParameters
(
this
As
TypeSymbol
,
track
As
TypeParameterKind
,
methodTypeParametersToTreatAsTypeTypeParameters
As
Bit
Array
methodTypeParametersToTreatAsTypeTypeParameters
As
Bit
Vector
)
As
TypeParameterKind
Select
Case
this
.
Kind
...
...
@@ -4858,7 +4858,7 @@ ContinueCandidatesLoop:
Dim
allFailedInferenceIsDueToObject
As
Boolean
=
False
Dim
someInferenceFailed
As
Boolean
=
False
Dim
inferenceErrorReasons
As
InferenceErrorReasons
=
InferenceErrorReasons
.
Other
Dim
inferredTypeByAssumption
As
Bit
Array
=
Nothing
Dim
inferredTypeByAssumption
As
Bit
Vector
=
Nothing
Dim
typeArgumentsLocation
As
ImmutableArray
(
Of
SyntaxNodeOrToken
)
=
Nothing
If
TypeArgumentInference
.
Infer
(
DirectCast
(
candidate
.
Candidate
.
UnderlyingSymbol
,
MethodSymbol
),
...
...
@@ -4920,7 +4920,7 @@ ContinueCandidatesLoop:
candidate
.
SetInferenceErrorReasons
(
inferenceErrorReasons
)
candidate
.
NotInferredTypeArguments
=
Bit
Array
.
Create
(
typeArguments
.
Length
)
candidate
.
NotInferredTypeArguments
=
Bit
Vector
.
Create
(
typeArguments
.
Length
)
For
i
As
Integer
=
0
To
typeArguments
.
Length
-
1
Step
1
If
typeArguments
(
i
)
Is
Nothing
Then
...
...
src/Compilers/VisualBasic/Portable/Semantics/TypeInference/TypeArgumentInference.vb
浏览文件 @
9346619f
...
...
@@ -29,12 +29,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
ByRef
allFailedInferenceIsDueToObject
As
Boolean
,
ByRef
someInferenceFailed
As
Boolean
,
ByRef
inferenceErrorReasons
As
InferenceErrorReasons
,
<
Out
>
ByRef
inferredTypeByAssumption
As
Bit
Array
,
<
Out
>
ByRef
inferredTypeByAssumption
As
Bit
Vector
,
<
Out
>
ByRef
typeArgumentsLocation
As
ImmutableArray
(
Of
SyntaxNodeOrToken
),
<
[
In
]
(),
Out
()
>
ByRef
asyncLambdaSubToFunctionMismatch
As
HashSet
(
Of
BoundExpression
),
<
[
In
]
,
Out
>
ByRef
useSiteDiagnostics
As
HashSet
(
Of
DiagnosticInfo
),
ByRef
diagnostic
As
DiagnosticBag
,
Optional
inferTheseTypeParameters
As
Bit
Array
=
Nothing
Optional
inferTheseTypeParameters
As
Bit
Vector
=
Nothing
)
As
Boolean
Debug
.
Assert
(
candidate
Is
candidate
.
ConstructedFrom
)
...
...
@@ -711,12 +711,12 @@ HandleAsAGeneralExpression:
ByRef
allFailedInferenceIsDueToObject
As
Boolean
,
ByRef
someInferenceFailed
As
Boolean
,
ByRef
inferenceErrorReasons
As
InferenceErrorReasons
,
<
Out
>
ByRef
inferredTypeByAssumption
As
Bit
Array
,
<
Out
>
ByRef
inferredTypeByAssumption
As
Bit
Vector
,
<
Out
>
ByRef
typeArgumentsLocation
As
ImmutableArray
(
Of
SyntaxNodeOrToken
),
<
[
In
]
(),
Out
()
>
ByRef
asyncLambdaSubToFunctionMismatch
As
HashSet
(
Of
BoundExpression
),
<
[
In
]
,
Out
>
ByRef
useSiteDiagnostics
As
HashSet
(
Of
DiagnosticInfo
),
ByRef
diagnostic
As
DiagnosticBag
,
inferTheseTypeParameters
As
Bit
Array
inferTheseTypeParameters
As
Bit
Vector
)
As
Boolean
Dim
graph
As
New
InferenceGraph
(
diagnostic
,
candidate
,
arguments
,
parameterToArgumentMap
,
paramArrayItems
,
delegateReturnType
,
delegateReturnTypeReferenceBoundNode
,
asyncLambdaSubToFunctionMismatch
,
...
...
@@ -896,7 +896,7 @@ HandleAsAGeneralExpression:
If
typeParameterNode
.
InferredTypeByAssumption
Then
If
inferredTypeByAssumption
.
IsNull
Then
inferredTypeByAssumption
=
Bit
Array
.
Create
(
arity
)
inferredTypeByAssumption
=
Bit
Vector
.
Create
(
arity
)
End
If
inferredTypeByAssumption
(
i
)
=
True
End
If
...
...
@@ -1051,7 +1051,7 @@ HandleAsAGeneralExpression:
node
As
ArgumentNode
,
isOutgoingEdge
As
Boolean
)
AddTypeToGraph
(
node
.
ParameterType
,
node
,
isOutgoingEdge
,
Bit
Array
.
Create
(
m_TypeParameterNodes
.
Length
))
AddTypeToGraph
(
node
.
ParameterType
,
node
,
isOutgoingEdge
,
Bit
Vector
.
Create
(
m_TypeParameterNodes
.
Length
))
End
Sub
Private
Function
FindTypeParameterNode
(
typeParameter
As
TypeParameterSymbol
)
As
TypeParameterNode
...
...
@@ -1070,7 +1070,7 @@ HandleAsAGeneralExpression:
parameterType
As
TypeSymbol
,
argNode
As
ArgumentNode
,
isOutgoingEdge
As
Boolean
,
ByRef
haveSeenTypeParameters
As
Bit
Array
ByRef
haveSeenTypeParameters
As
Bit
Vector
)
Select
Case
parameterType
.
Kind
Case
SymbolKind
.
TypeParameter
...
...
@@ -1124,7 +1124,7 @@ HandleAsAGeneralExpression:
Debug
.
Assert
(
argNode
.
Expression
.
Kind
=
BoundKind
.
AddressOfOperator
)
If
parameterType
.
IsTypeParameter
()
Then
AddTypeToGraph
(
parameterType
,
argNode
,
isOutgoingEdge
:
=
True
,
haveSeenTypeParameters
:
=
Bit
Array
.
Create
(
m_TypeParameterNodes
.
Length
))
AddTypeToGraph
(
parameterType
,
argNode
,
isOutgoingEdge
:
=
True
,
haveSeenTypeParameters
:
=
Bit
Vector
.
Create
(
m_TypeParameterNodes
.
Length
))
ElseIf
parameterType
.
IsDelegateType
()
Then
Dim
delegateType
As
NamedTypeSymbol
=
DirectCast
(
parameterType
,
NamedTypeSymbol
)
...
...
@@ -1132,7 +1132,7 @@ HandleAsAGeneralExpression:
If
invoke
IsNot
Nothing
AndAlso
invoke
.
GetUseSiteErrorInfo
()
Is
Nothing
AndAlso
delegateType
.
IsGenericType
Then
Dim
haveSeenTypeParameters
=
Bit
Array
.
Create
(
m_TypeParameterNodes
.
Length
)
Dim
haveSeenTypeParameters
=
Bit
Vector
.
Create
(
m_TypeParameterNodes
.
Length
)
AddTypeToGraph
(
invoke
.
ReturnType
,
argNode
,
isOutgoingEdge
:
=
True
,
haveSeenTypeParameters
:
=
haveSeenTypeParameters
)
' outgoing (name->type) edge
haveSeenTypeParameters
.
Clear
()
...
...
@@ -1158,7 +1158,7 @@ HandleAsAGeneralExpression:
)
If
parameterType
.
IsTypeParameter
()
Then
' Lambda is bound to a generic typeParam, just infer anonymous delegate
AddTypeToGraph
(
parameterType
,
argNode
,
isOutgoingEdge
:
=
True
,
haveSeenTypeParameters
:
=
Bit
Array
.
Create
(
m_TypeParameterNodes
.
Length
))
AddTypeToGraph
(
parameterType
,
argNode
,
isOutgoingEdge
:
=
True
,
haveSeenTypeParameters
:
=
Bit
Vector
.
Create
(
m_TypeParameterNodes
.
Length
))
ElseIf
parameterType
.
IsDelegateType
()
Then
Dim
delegateType
As
NamedTypeSymbol
=
DirectCast
(
parameterType
,
NamedTypeSymbol
)
...
...
@@ -1180,7 +1180,7 @@ HandleAsAGeneralExpression:
Throw
ExceptionUtilities
.
UnexpectedValue
(
argNode
.
Expression
.
Kind
)
End
Select
Dim
haveSeenTypeParameters
=
Bit
Array
.
Create
(
m_TypeParameterNodes
.
Length
)
Dim
haveSeenTypeParameters
=
Bit
Vector
.
Create
(
m_TypeParameterNodes
.
Length
)
For
i
As
Integer
=
0
To
Math
.
Min
(
delegateParemeters
.
Length
,
lambdaParameters
.
Length
)
-
1
Step
1
If
lambdaParameters
(
i
).
Type
IsNot
Nothing
Then
...
...
src/Compilers/VisualBasic/Portable/Symbols/ReducedExtensionMethodSymbol.vb
浏览文件 @
9346619f
...
...
@@ -71,7 +71,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Dim
someInferenceFailed
As
Boolean
=
False
Dim
inferenceErrorReasons
As
InferenceErrorReasons
=
InferenceErrorReasons
.
Other
Dim
fixTheseTypeParameters
=
Bit
Array
.
Create
(
possiblyExtensionMethod
.
Arity
)
Dim
fixTheseTypeParameters
=
Bit
Vector
.
Create
(
possiblyExtensionMethod
.
Arity
)
For
Each
typeParameter
As
TypeParameterSymbol
In
hashSetOfTypeParametersToFix
fixTheseTypeParameters
(
typeParameter
.
Ordinal
)
=
True
...
...
src/Compilers/VisualBasic/Portable/Symbols/TypeSubstitution.vb
浏览文件 @
9346619f
...
...
@@ -314,7 +314,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Dim
currentParent
As
TypeSubstitution
=
Nothing
Dim
currentContainer
As
Symbol
=
Nothing
#If DEBUG Then
Dim
haveSubstitutionForOrdinal
=
Bit
Array
.
Create
(
params
.
Length
)
Dim
haveSubstitutionForOrdinal
=
Bit
Vector
.
Create
(
params
.
Length
)
#End If
Dim
pairs
=
ArrayBuilder
(
Of
KeyValuePair
(
Of
TypeParameterSymbol
,
TypeSymbol
)).
GetInstance
()
...
...
@@ -630,7 +630,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Dim
pairsHaveChanged
As
Boolean
=
False
Dim
oldPairs
=
oldConstructSubstitution
.
Pairs
Dim
haveSubstitutionForOrdinal
As
Bit
Array
=
Nothing
Dim
haveSubstitutionForOrdinal
As
Bit
Vector
=
Nothing
Dim
targetGenericDefinition
As
Symbol
=
oldConstructSubstitution
.
TargetGenericDefinition
If
oldPairs
.
Length
>
0
Then
...
...
@@ -642,7 +642,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
arity
=
DirectCast
(
targetGenericDefinition
,
NamedTypeSymbol
).
Arity
End
If
haveSubstitutionForOrdinal
=
Bit
Array
.
Create
(
arity
)
haveSubstitutionForOrdinal
=
Bit
Vector
.
Create
(
arity
)
End
If
For
i
=
0
To
oldPairs
.
Length
-
1
Step
1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录