Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FAR counting for target-typed new #48434

Merged
merged 2 commits into from
Nov 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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