Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
decc3fc6
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,发现更多精彩内容 >>
未验证
提交
decc3fc6
编写于
7月 31, 2019
作者:
D
dotnet-automerge-bot
提交者:
GitHub
7月 31, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #37633 from dotnet/merges/release/dev16.2-to-release/dev16.3-preview1
Merge release/dev16.2 to release/dev16.3-preview1
上级
5aa130d8
5d8ba22f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
18 deletion
+16
-18
eng/Versions.props
eng/Versions.props
+1
-1
src/EditorFeatures/CSharpTest/DisposeAnalysis/DisposeObjectsBeforeLosingScopeTests.cs
...t/DisposeAnalysis/DisposeObjectsBeforeLosingScopeTests.cs
+8
-9
src/EditorFeatures/VisualBasicTest/DisposeAnalysis/DisposeObjectsBeforeLosingScopeTests.vb
...t/DisposeAnalysis/DisposeObjectsBeforeLosingScopeTests.vb
+7
-8
未找到文件。
eng/Versions.props
浏览文件 @
decc3fc6
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
<MicrosoftCodeAnalysisTestResourcesProprietaryVersion>
2.0.17
</MicrosoftCodeAnalysisTestResourcesProprietaryVersion>
<MicrosoftCodeAnalysisTestResourcesProprietaryVersion>
2.0.17
</MicrosoftCodeAnalysisTestResourcesProprietaryVersion>
<MicrosoftCodeAnalysisVisualBasicCodeFixTestingXUnitVersion>
$(MicrosoftCodeAnalysisTestingVersion)
</MicrosoftCodeAnalysisVisualBasicCodeFixTestingXUnitVersion>
<MicrosoftCodeAnalysisVisualBasicCodeFixTestingXUnitVersion>
$(MicrosoftCodeAnalysisTestingVersion)
</MicrosoftCodeAnalysisVisualBasicCodeFixTestingXUnitVersion>
<MicrosoftCodeAnalysisVisualBasicCodeStyleVersion>
$(CodeStyleAnalyzerVersion)
</MicrosoftCodeAnalysisVisualBasicCodeStyleVersion>
<MicrosoftCodeAnalysisVisualBasicCodeStyleVersion>
$(CodeStyleAnalyzerVersion)
</MicrosoftCodeAnalysisVisualBasicCodeStyleVersion>
<MicrosoftCodeAnalysisFlowAnalysisUtilitiesVersion>
2.9.4
-beta1.19321.5+ffe2b1b5
</MicrosoftCodeAnalysisFlowAnalysisUtilitiesVersion>
<MicrosoftCodeAnalysisFlowAnalysisUtilitiesVersion>
2.9.4
</MicrosoftCodeAnalysisFlowAnalysisUtilitiesVersion>
<MicrosoftCodeQualityAnalyzersVersion>
$(RoslynDiagnosticsNugetPackageVersion)
</MicrosoftCodeQualityAnalyzersVersion>
<MicrosoftCodeQualityAnalyzersVersion>
$(RoslynDiagnosticsNugetPackageVersion)
</MicrosoftCodeQualityAnalyzersVersion>
<SystemCompositionVersion>
1.0.31
</SystemCompositionVersion>
<SystemCompositionVersion>
1.0.31
</SystemCompositionVersion>
<MicrosoftCSharpVersion>
4.3.0
</MicrosoftCSharpVersion>
<MicrosoftCSharpVersion>
4.3.0
</MicrosoftCSharpVersion>
...
...
src/EditorFeatures/CSharpTest/DisposeAnalysis/DisposeObjectsBeforeLosingScopeTests.cs
浏览文件 @
decc3fc6
...
@@ -4803,9 +4803,10 @@ public Task<C> M1_Task()
...
@@ -4803,9 +4803,10 @@ public Task<C> M1_Task()
}
}
[
Fact
,
WorkItem
(
2212
,
"https://github.com/dotnet/roslyn-analyzers/issues/2212"
)]
[
Fact
,
WorkItem
(
2212
,
"https://github.com/dotnet/roslyn-analyzers/issues/2212"
)]
public
async
Task
AwaitedButNotDisposed_Diagnostic
()
public
async
Task
AwaitedButNotDisposed_
No
Diagnostic
()
{
{
await
TestDiagnosticsAsync
(
@"
// We are conservative when disposable object gets wrapped in a task and consider it as escaped.
await
TestDiagnosticMissingAsync
(
@"
using System;
using System;
using System.Threading.Tasks;
using System.Threading.Tasks;
...
@@ -4826,14 +4827,13 @@ public async Task M2_Task()
...
@@ -4826,14 +4827,13 @@ public async Task M2_Task()
var c = await M1_Task().ConfigureAwait(false);
var c = await M1_Task().ConfigureAwait(false);
}
}
|]
|]
}"
,
}"
);
Diagnostic
(
IDEDiagnosticIds
.
DisposeObjectsBeforeLosingScopeDiagnosticId
,
"await M1_Task().ConfigureAwait(false)"
).
WithLocation
(
19
,
17
));
}
}
[
Fact
,
WorkItem
(
2212
,
"https://github.com/dotnet/roslyn-analyzers/issues/2212"
)]
[
Fact
,
WorkItem
(
2212
,
"https://github.com/dotnet/roslyn-analyzers/issues/2212"
)]
public
async
Task
AwaitedButNotDisposed_TaskWrappingField_Diagnostic
()
public
async
Task
AwaitedButNotDisposed_TaskWrappingField_
No
Diagnostic
()
{
{
await
TestDiagnostic
s
Async
(
@"
await
TestDiagnostic
Missing
Async
(
@"
using System;
using System;
using System.Threading.Tasks;
using System.Threading.Tasks;
...
@@ -4855,8 +4855,7 @@ public async Task M2_Task()
...
@@ -4855,8 +4855,7 @@ public async Task M2_Task()
var c = await M1_Task().ConfigureAwait(false);
var c = await M1_Task().ConfigureAwait(false);
}
}
|]
|]
}"
,
}"
);
Diagnostic
(
IDEDiagnosticIds
.
DisposeObjectsBeforeLosingScopeDiagnosticId
,
"await M1_Task().ConfigureAwait(false)"
).
WithLocation
(
20
,
17
));
}
}
[
Fact
,
WorkItem
(
2347
,
"https://github.com/dotnet/roslyn-analyzers/issues/2347"
)]
[
Fact
,
WorkItem
(
2347
,
"https://github.com/dotnet/roslyn-analyzers/issues/2347"
)]
...
@@ -4914,7 +4913,7 @@ public async Task M2_Task()
...
@@ -4914,7 +4913,7 @@ public async Task M2_Task()
}
}
|]
|]
}"
,
}"
,
Diagnostic
(
IDEDiagnosticIds
.
DisposeObjectsBeforeLosingScopeDiagnosticId
,
"
await M1_Task(null).ConfigureAwait(false)"
).
WithLocation
(
20
,
17
));
Diagnostic
(
IDEDiagnosticIds
.
DisposeObjectsBeforeLosingScopeDiagnosticId
,
"
M1_Task(null)"
).
WithLocation
(
20
,
23
));
}
}
[
Fact
,
WorkItem
(
2361
,
"https://github.com/dotnet/roslyn-analyzers/issues/2361"
)]
[
Fact
,
WorkItem
(
2361
,
"https://github.com/dotnet/roslyn-analyzers/issues/2361"
)]
...
...
src/EditorFeatures/VisualBasicTest/DisposeAnalysis/DisposeObjectsBeforeLosingScopeTests.vb
浏览文件 @
decc3fc6
...
@@ -2775,8 +2775,9 @@ End Class")
...
@@ -2775,8 +2775,9 @@ End Class")
End
Function
End
Function
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
DisposeAnalysis
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
DisposeAnalysis
)
>
Public
Async
Function
AwaitedButNotDisposed_Diagnostic
()
As
Task
Public
Async
Function
AwaitedButNotDisposed_NoDiagnostic
()
As
Task
Await
TestDiagnosticsAsync
(
' We are conservative when disposable object gets wrapped in a task and consider it as escaped.
Await
TestDiagnosticMissingAsync
(
"Imports System
"Imports System
Imports System.Threading.Tasks
Imports System.Threading.Tasks
...
@@ -2795,13 +2796,12 @@ Class C
...
@@ -2795,13 +2796,12 @@ Class C
Dim c = Await M1_Task().ConfigureAwait(False)
Dim c = Await M1_Task().ConfigureAwait(False)
End Function
End Function
|]
|]
End Class"
,
End Class"
)
Diagnostic
(
IDEDiagnosticIds
.
DisposeObjectsBeforeLosingScopeDiagnosticId
,
"Await M1_Task().ConfigureAwait(False)"
).
WithLocation
(
16
,
17
))
End
Function
End
Function
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
DisposeAnalysis
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
DisposeAnalysis
)
>
Public
Async
Function
AwaitedButNotDisposed_TaskWrappingField_Diagnostic
()
As
Task
Public
Async
Function
AwaitedButNotDisposed_TaskWrappingField_
No
Diagnostic
()
As
Task
Await
TestDiagnostic
s
Async
(
Await
TestDiagnostic
Missing
Async
(
"Imports System
"Imports System
Imports System.Threading.Tasks
Imports System.Threading.Tasks
...
@@ -2822,8 +2822,7 @@ Class C
...
@@ -2822,8 +2822,7 @@ Class C
Dim c = Await M1_Task().ConfigureAwait(False)
Dim c = Await M1_Task().ConfigureAwait(False)
End Function
End Function
|]
|]
End Class"
,
End Class"
)
Diagnostic
(
IDEDiagnosticIds
.
DisposeObjectsBeforeLosingScopeDiagnosticId
,
"Await M1_Task().ConfigureAwait(False)"
).
WithLocation
(
18
,
17
))
End
Function
End
Function
End
Class
End
Class
End
Namespace
End
Namespace
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录