Skip to content

Commit

Permalink
Merge pull request #48434 from Youssef1313/target-typed-new-ctor-coun…
Browse files Browse the repository at this point in the history
…ting

Fix FAR counting for target-typed new
  • Loading branch information
sharwell authored Nov 8, 2020
2 parents a8d9b86 + a09802d commit 11e3b9e
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,34 @@ class C
Await TestAPIAndFeature(input, kind, host)
End Function

<WpfTheory, CombinatorialData, Trait(Traits.Feature, Traits.Features.FindReferences)>
<WorkItem(47987, "https://github.com/dotnet/roslyn/issues/47987")>
Public Async Function DoNotCountInstantiationTwiceWhenTargetTypedNewExists(kind As TestKind, host As TestHost) As Task
Dim input =
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document>
class Bar
{
public {|Definition:$$Bar|}() { }
}
</Document>
<Document>
public class Foo
{
private readonly Bar bar1 = [|new|]();
private readonly Bar bar2;
public Foo(Bar bar)
{
this.bar2 = new [|Bar|]();
}
}
</Document>
</Project>
</Workspace>
Await TestAPIAndFeature(input, kind, host)
End Function

<WorkItem(44288, "https://github.com/dotnet/roslyn/issues/44288")>
<WpfTheory, CombinatorialData, Trait(Traits.Feature, Traits.Features.FindReferences)>
Public Async Function TestConstructorReferenceInGlobalSuppression(kind As TestKind, host As TestHost) As Task
Expand Down

0 comments on commit 11e3b9e

Please sign in to comment.