Skip to content

Commit 2636bc1

Browse files
committed
Add analyzer test provided by @meziantou in #1363
It isn't clear how to fix this without slowing down the analyzer significantly. As this has not been a highly requested, I'm going to Won't Fix this. Closes #1363
1 parent 7edc257 commit 2636bc1

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)