Skip to content

Commit e9525db

Browse files
authored
Merge pull request #1386 from microsoft/fix1158
Add analyzer test to record a future opportunity
2 parents c7d34d1 + 2636bc1 commit e9525db

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/Microsoft.VisualStudio.Threading.Analyzers.Tests/VSTHRD110ObserveResultOfAsyncCallsAnalyzerTests.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,33 @@ void Bar() { }
247247
await CSVerify.VerifyAnalyzerAsync(test, expected);
248248
}
249249

250+
[Fact(Skip = "Won't fix")]
251+
public async Task GetAwaiterWithIncompatibleParameters()
252+
{
253+
string test = /* lang=c#-test */ """
254+
using System;
255+
using System.Collections.Generic;
256+
using System.Runtime.CompilerServices;
257+
using System.Threading.Tasks;
258+
259+
class Test
260+
{
261+
void Foo()
262+
{
263+
var stack = new Stack<(int, int)>();
264+
stack.Pop();
265+
}
266+
}
267+
268+
internal static class Extensions
269+
{
270+
internal static TaskAwaiter<(T1, T2)> GetAwaiter<T1, T2>(this (Task<T1>, Task<T2>) tasks) => throw new NotImplementedException();
271+
}
272+
""";
273+
274+
await CSVerify.VerifyAnalyzerAsync(test);
275+
}
276+
250277
[Fact]
251278
public async Task ConfigureAwait_ProducesDiagnostics()
252279
{

0 commit comments

Comments
 (0)