Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
7d668335
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,发现更多精彩内容 >>
提交
7d668335
编写于
3月 16, 2015
作者:
C
Charles Stoner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Incorporate PR feedback
上级
9123539b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
22 addition
and
18 deletion
+22
-18
src/Compilers/CSharp/Portable/Emitter/EditAndContinue/CSharpSymbolMatcher.cs
...p/Portable/Emitter/EditAndContinue/CSharpSymbolMatcher.cs
+1
-1
src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/AnonymousTypeManager.Templates.cs
.../Symbols/AnonymousTypes/AnonymousTypeManager.Templates.cs
+3
-3
src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousType.TemplateSymbol.cs
...sTypes/SynthesizedSymbols/AnonymousType.TemplateSymbol.cs
+3
-2
src/Compilers/Core/Portable/Emit/AnonymousTypeKey.cs
src/Compilers/Core/Portable/Emit/AnonymousTypeKey.cs
+11
-9
src/Compilers/VisualBasic/Portable/Emit/EditAndContinue/PEDeltaAssemblyBuilder.vb
...c/Portable/Emit/EditAndContinue/PEDeltaAssemblyBuilder.vb
+3
-2
src/Compilers/VisualBasic/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousDelegate_TemplateSymbol.vb
...es/SynthesizedSymbols/AnonymousDelegate_TemplateSymbol.vb
+1
-1
未找到文件。
src/Compilers/CSharp/Portable/Emitter/EditAndContinue/CSharpSymbolMatcher.cs
浏览文件 @
7d668335
...
...
@@ -525,7 +525,7 @@ internal bool TryFindAnonymousType(NamedTypeSymbol type, out AnonymousTypeValue
Debug
.
Assert
((
object
)
type
.
ContainingSymbol
==
(
object
)
_sourceAssembly
.
GlobalNamespace
);
Debug
.
Assert
(
AnonymousTypeManager
.
IsAnonymousTypeTemplate
(
type
));
var
key
=
new
AnonymousTypeKey
(
AnonymousTypeManager
.
GetTemplatePropertyNames
(
type
)
);
var
key
=
AnonymousTypeManager
.
GetAnonymousTypeKey
(
type
);
return
_anonymousTypeMap
.
TryGetValue
(
key
,
out
otherType
);
}
...
...
src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/AnonymousTypeManager.Templates.cs
浏览文件 @
7d668335
...
...
@@ -366,9 +366,9 @@ public void AssignTemplatesNamesAndCompile(MethodCompiler compiler, PEModuleBuil
}
}
internal
static
ImmutableArray
<
string
>
GetTemplatePropertyNames
(
NamedTypeSymbol
type
)
internal
static
Microsoft
.
CodeAnalysis
.
Emit
.
AnonymousTypeKey
GetAnonymousTypeKey
(
NamedTypeSymbol
type
)
{
return
((
AnonymousTypeTemplateSymbol
)
type
).
Get
PropertyNames
();
return
((
AnonymousTypeTemplateSymbol
)
type
).
Get
AnonymousTypeKey
();
}
internal
IReadOnlyDictionary
<
Microsoft
.
CodeAnalysis
.
Emit
.
AnonymousTypeKey
,
Microsoft
.
CodeAnalysis
.
Emit
.
AnonymousTypeValue
>
GetAnonymousTypeMap
()
...
...
@@ -378,7 +378,7 @@ internal static ImmutableArray<string> GetTemplatePropertyNames(NamedTypeSymbol
foreach
(
AnonymousTypeTemplateSymbol
template
in
templates
)
{
var
nameAndIndex
=
template
.
NameAndIndex
;
var
key
=
new
Microsoft
.
CodeAnalysis
.
Emit
.
AnonymousTypeKey
(
template
.
GetPropertyNames
()
);
var
key
=
template
.
GetAnonymousTypeKey
(
);
var
value
=
new
Microsoft
.
CodeAnalysis
.
Emit
.
AnonymousTypeValue
(
nameAndIndex
.
Name
,
nameAndIndex
.
Index
,
template
);
result
.
Add
(
key
,
value
);
}
...
...
src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousType.TemplateSymbol.cs
浏览文件 @
7d668335
...
...
@@ -131,9 +131,10 @@ internal AnonymousTypeTemplateSymbol(AnonymousTypeManager manager, AnonymousType
this
.
SpecialMembers
=
specialMembers
.
AsImmutable
();
}
internal
ImmutableArray
<
string
>
GetPropertyNames
()
internal
Microsoft
.
CodeAnalysis
.
Emit
.
AnonymousTypeKey
GetAnonymousTypeKey
()
{
return
this
.
Properties
.
SelectAsArray
(
p
=>
p
.
Name
);
var
properties
=
this
.
Properties
.
SelectAsArray
(
p
=>
new
Microsoft
.
CodeAnalysis
.
Emit
.
AnonymousTypeKeyField
(
p
.
Name
));
return
new
Microsoft
.
CodeAnalysis
.
Emit
.
AnonymousTypeKey
(
properties
);
}
/// <summary>
...
...
src/Compilers/Core/Portable/Emit/AnonymousTypeKey.cs
浏览文件 @
7d668335
...
...
@@ -11,10 +11,17 @@ namespace Microsoft.CodeAnalysis.Emit
{
internal
struct
AnonymousTypeKeyField
:
IEquatable
<
AnonymousTypeKeyField
>
{
/// <summary>
/// Name of the anonymous type field.
/// </summary>
internal
readonly
string
Name
;
/// <summary>
/// True if the anonymous type field was marked as 'Key' in VB.
/// </summary>
internal
readonly
bool
IsKey
;
internal
AnonymousTypeKeyField
(
string
name
,
bool
isKey
)
internal
AnonymousTypeKeyField
(
string
name
,
bool
isKey
=
false
)
{
this
.
Name
=
name
;
this
.
IsKey
=
isKey
;
...
...
@@ -44,15 +51,10 @@ public override string ToString()
[
DebuggerDisplay
(
"{GetDebuggerDisplay(), nq}"
)]
internal
struct
AnonymousTypeKey
:
IEquatable
<
AnonymousTypeKey
>
{
public
readonly
bool
IsDelegate
;
public
readonly
ImmutableArray
<
AnonymousTypeKeyField
>
Fields
;
public
AnonymousTypeKey
(
ImmutableArray
<
string
>
names
)
{
throw
new
NotImplementedException
();
}
internal
readonly
bool
IsDelegate
;
internal
readonly
ImmutableArray
<
AnonymousTypeKeyField
>
Fields
;
public
AnonymousTypeKey
(
ImmutableArray
<
AnonymousTypeKeyField
>
fields
,
bool
isDelegate
=
false
)
internal
AnonymousTypeKey
(
ImmutableArray
<
AnonymousTypeKeyField
>
fields
,
bool
isDelegate
=
false
)
{
this
.
IsDelegate
=
isDelegate
;
this
.
Fields
=
fields
;
...
...
src/Compilers/VisualBasic/Portable/Emit/EditAndContinue/PEDeltaAssemblyBuilder.vb
浏览文件 @
7d668335
...
...
@@ -116,6 +116,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Emit
Debug
.
Assert
(
typeParameter
.
ContainingSymbol
=
type
)
Dim
index
=
typeParameter
.
Ordinal
Debug
.
Assert
(
properties
(
index
).
Name
Is
Nothing
)
' ReadOnly anonymous type properties were 'Key' properties.
properties
(
index
)
=
New
AnonymousTypeKeyField
(
[
property
]
.
Name
,
[
property
]
.
IsReadOnly
)
End
If
Next
...
...
@@ -134,8 +135,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Emit
Dim
method
=
DirectCast
(
members
(
0
),
MethodSymbol
)
Debug
.
Assert
(
method
.
Parameters
.
Count
+
If
(
method
.
IsSub
,
0
,
1
)
=
type
.
TypeParameters
.
Length
)
Dim
parameters
=
ArrayBuilder
(
Of
AnonymousTypeKeyField
).
GetInstance
()
parameters
.
AddRange
(
method
.
Parameters
.
SelectAsArray
(
Function
(
p
)
New
AnonymousTypeKeyField
(
p
.
Name
,
isKey
:
=
False
)))
parameters
.
Add
(
New
AnonymousTypeKeyField
(
AnonymousTypeDescriptor
.
GetReturnParameterName
(
Not
method
.
IsSub
)
,
isKey
:
=
False
))
parameters
.
AddRange
(
method
.
Parameters
.
SelectAsArray
(
Function
(
p
)
New
AnonymousTypeKeyField
(
p
.
Name
)))
parameters
.
Add
(
New
AnonymousTypeKeyField
(
AnonymousTypeDescriptor
.
GetReturnParameterName
(
Not
method
.
IsSub
)))
Return
New
AnonymousTypeKey
(
parameters
.
ToImmutableAndFree
(),
isDelegate
:
=
True
)
End
Function
...
...
src/Compilers/VisualBasic/Portable/Symbols/AnonymousTypes/SynthesizedSymbols/AnonymousDelegate_TemplateSymbol.vb
浏览文件 @
7d668335
...
...
@@ -125,7 +125,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End
Sub
Friend
Overrides
Function
GetAnonymousTypeKey
()
As
Microsoft
.
CodeAnalysis
.
Emit
.
AnonymousTypeKey
Dim
parameters
=
TypeDescr
.
Parameters
.
SelectAsArray
(
Function
(
p
)
New
Microsoft
.
CodeAnalysis
.
Emit
.
AnonymousTypeKeyField
(
p
.
Name
,
p
.
IsByRef
))
Dim
parameters
=
TypeDescr
.
Parameters
.
SelectAsArray
(
Function
(
p
)
New
Microsoft
.
CodeAnalysis
.
Emit
.
AnonymousTypeKeyField
(
p
.
Name
))
Return
New
Microsoft
.
CodeAnalysis
.
Emit
.
AnonymousTypeKey
(
parameters
,
isDelegate
:
=
True
)
End
Function
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录