Skip to content

Commit

Permalink
Merge pull request #1386 from microsoft/fix1158
Browse files Browse the repository at this point in the history
Add analyzer test to record a future opportunity
  • Loading branch information
AArnott authored Feb 6, 2025
2 parents c7d34d1 + 2636bc1 commit e9525db
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,33 @@ void Bar() { }
await CSVerify.VerifyAnalyzerAsync(test, expected);
}

[Fact(Skip = "Won't fix")]
public async Task GetAwaiterWithIncompatibleParameters()
{
string test = /* lang=c#-test */ """
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
class Test
{
void Foo()
{
var stack = new Stack<(int, int)>();
stack.Pop();
}
}
internal static class Extensions
{
internal static TaskAwaiter<(T1, T2)> GetAwaiter<T1, T2>(this (Task<T1>, Task<T2>) tasks) => throw new NotImplementedException();
}
""";

await CSVerify.VerifyAnalyzerAsync(test);
}

[Fact]
public async Task ConfigureAwait_ProducesDiagnostics()
{
Expand Down

0 comments on commit e9525db

Please sign in to comment.