Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
07be42bc
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,发现更多精彩内容 >>
提交
07be42bc
编写于
4月 25, 2017
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix logic that was making us unify different local functions if their signatures matched.
上级
865fef48
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
203 addition
and
3 deletion
+203
-3
src/EditorFeatures/Test2/EditorServicesTest2.vbproj
src/EditorFeatures/Test2/EditorServicesTest2.vbproj
+1
-0
src/EditorFeatures/Test2/FindReferences/FindReferencesTests.LocalFunctions.vb
...est2/FindReferences/FindReferencesTests.LocalFunctions.vb
+196
-0
src/Workspaces/Core/Portable/Shared/Utilities/SymbolEquivalenceComparer.EquivalenceVisitor.cs
...Utilities/SymbolEquivalenceComparer.EquivalenceVisitor.cs
+6
-3
未找到文件。
src/EditorFeatures/Test2/EditorServicesTest2.vbproj
浏览文件 @
07be42bc
...
...
@@ -191,6 +191,7 @@
<Compile
Include=
"Diagnostics\UseAutoProperty\UseAutoPropertyTests.vb"
/>
<Compile
Include=
"Expansion\LambdaParameterExpansionTests.vb"
/>
<Compile
Include=
"FindReferences\FindReferencesTests.Literals.vb"
/>
<Compile
Include=
"FindReferences\FindReferencesTests.LocalFunctions.vb"
/>
<Compile
Include=
"FindReferences\FindReferencesTests.Tuples.vb"
/>
<Compile
Include=
"GoToImplementation\GoToImplementationTests.vb"
/>
<Compile
Include=
"IntelliSense\CompletionServiceTests.vb"
/>
...
...
src/EditorFeatures/Test2/FindReferences/FindReferencesTests.LocalFunctions.vb
0 → 100644
浏览文件 @
07be42bc
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports
System.Threading.Tasks
Namespace
Microsoft.CodeAnalysis.Editor.UnitTests.FindReferences
Partial
Public
Class
FindReferencesTests
<
WorkItem
(
18761
,
"https://github.com/dotnet/roslyn/issues/18761"
)
>
<
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
FindReferences
)
>
Public
Async
Function
TestLocalFunction1
()
As
Task
Dim
input
=
<
Workspace
>
<
Project
Language
=
"C#"
CommonReferences
=
"true"
>
<
Document
>
class
Test
{
void
Main
()
{
{
int
x
=
1
;
[|$$
Print
|]
(
x
)
;
void
{
|
Definition
:
Print
|
}(
int
y
)
{
}
}
{
int
z
=
1
;
Print
(
z
)
;
void
Print
(
int
y
)
{
}
}
}
}
</
Document
>
</
Project
>
</
Workspace
>
Await
TestAPIAndFeature
(
input
)
End
Function
<
WorkItem
(
18761
,
"https://github.com/dotnet/roslyn/issues/18761"
)
>
<
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
FindReferences
)
>
Public
Async
Function
TestLocalFunction2
()
As
Task
Dim
input
=
<
Workspace
>
<
Project
Language
=
"C#"
CommonReferences
=
"true"
>
<
Document
>
class
Test
{
void
Main
()
{
{
int
x
=
1
;
[|
Print
|]
(
x
)
;
void
{
|
Definition
:
$$
Print
|
}(
int
y
)
{
}
}
{
int
z
=
1
;
Print
(
z
)
;
void
Print
(
int
y
)
{
}
}
}
}
</
Document
>
</
Project
>
</
Workspace
>
Await
TestAPIAndFeature
(
input
)
End
Function
<
WorkItem
(
18761
,
"https://github.com/dotnet/roslyn/issues/18761"
)
>
<
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
FindReferences
)
>
Public
Async
Function
TestLocalFunction3
()
As
Task
Dim
input
=
<
Workspace
>
<
Project
Language
=
"C#"
CommonReferences
=
"true"
>
<
Document
>
class
Test
{
void
Main
()
{
{
int
x
=
1
;
Print
(
x
)
;
void
Print
(
int
y
)
{
}
}
{
int
z
=
1
;
[|$$
Print
|]
(
z
)
;
void
{
|
Definition
:
Print
|
}(
int
y
)
{
}
}
}
}
</
Document
>
</
Project
>
</
Workspace
>
Await
TestAPIAndFeature
(
input
)
End
Function
<
WorkItem
(
18761
,
"https://github.com/dotnet/roslyn/issues/18761"
)
>
<
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
FindReferences
)
>
Public
Async
Function
TestLocalFunction4
()
As
Task
Dim
input
=
<
Workspace
>
<
Project
Language
=
"C#"
CommonReferences
=
"true"
>
<
Document
>
class
Test
{
void
Main
()
{
{
int
x
=
1
;
Print
(
x
)
;
void
Print
(
int
y
)
{
}
}
{
int
z
=
1
;
[|
Print
|]
(
z
)
;
void
{
|
Definition
:
$$
Print
|
}(
int
y
)
{
}
}
}
}
</
Document
>
</
Project
>
</
Workspace
>
Await
TestAPIAndFeature
(
input
)
End
Function
<
WorkItem
(
18761
,
"https://github.com/dotnet/roslyn/issues/18761"
)
>
<
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
FindReferences
)
>
Public
Async
Function
TestGenericLocalFunction1
()
As
Task
Dim
input
=
<
Workspace
>
<
Project
Language
=
"C#"
CommonReferences
=
"true"
>
<
Document
>
class
Test
{
void
Main
()
{
int
x
=
1
;
[|
Print
|]
(
x
)
;
[|
Print
|]
&
lt
;
int>
;
(
x
)
;
void
{
|
Definition
:
$$
Print
|
}
&
lt
;
T
&
gt
;
(
T
y
)
{
}
}
}
</
Document
>
</
Project
>
</
Workspace
>
Await
TestAPIAndFeature
(
input
)
End
Function
<
WorkItem
(
18761
,
"https://github.com/dotnet/roslyn/issues/18761"
)
>
<
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
FindReferences
)
>
Public
Async
Function
TestGenericLocalFunction2
()
As
Task
Dim
input
=
<
Workspace
>
<
Project
Language
=
"C#"
CommonReferences
=
"true"
>
<
Document
>
class
Test
{
void
Main
()
{
int
x
=
1
;
[|
Print
|]
(
x
)
;
[|$$
Print
|]
&
lt
;
int>
;
(
x
)
;
void
{
|
Definition
:
Print
|
}
&
lt
;
T
&
gt
;
(
T
y
)
{
}
}
}
</
Document
>
</
Project
>
</
Workspace
>
Await
TestAPIAndFeature
(
input
)
End
Function
<
WorkItem
(
18761
,
"https://github.com/dotnet/roslyn/issues/18761"
)
>
<
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
FindReferences
)
>
Public
Async
Function
TestGenericLocalFunction3
()
As
Task
Dim
input
=
<
Workspace
>
<
Project
Language
=
"C#"
CommonReferences
=
"true"
>
<
Document
>
class
Test
{
void
Main
()
{
int
x
=
1
;
[|$$
Print
|]
(
x
)
;
[|
Print
|]
&
lt
;
int>
;
(
x
)
;
void
{
|
Definition
:
Print
|
}
&
lt
;
T
&
gt
;
(
T
y
)
{
}
}
}
</
Document
>
</
Project
>
</
Workspace
>
Await
TestAPIAndFeature
(
input
)
End
Function
End
Class
End
Namespace
\ No newline at end of file
src/Workspaces/Core/Portable/Shared/Utilities/SymbolEquivalenceComparer.EquivalenceVisitor.cs
浏览文件 @
07be42bc
...
...
@@ -211,8 +211,11 @@ private bool MethodsAreEquivalent(IMethodSymbol x, IMethodSymbol y, Dictionary<I
}
else
{
if
(
x
.
MethodKind
==
MethodKind
.
AnonymousFunction
)
if
(
x
.
MethodKind
==
MethodKind
.
AnonymousFunction
||
x
.
MethodKind
==
MethodKind
.
LocalFunction
)
{
// Treat local and anonymous functions just like we do ILocalSymbols.
// They're only equivalent if they have the same location.
return
HaveSameLocation
(
x
,
y
);
}
...
...
@@ -351,7 +354,7 @@ private bool HandleNamedTypesWorker(INamedTypeSymbol x, INamedTypeSymbol y, Dict
return
false
;
}
for
(
int
i
=
0
;
i
<
xElements
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
xElements
.
Length
;
i
++)
{
if
(!
AreEquivalent
(
xElements
[
i
].
Type
,
yElements
[
i
].
Type
,
equivalentTypesWithDifferingAssemblies
))
{
...
...
@@ -604,4 +607,4 @@ private bool PreprocessingSymbolsAreEquivalent(IPreprocessingSymbol x, IPreproce
}
}
}
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录