Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix FAR counting for target-typed new#48434

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@Youssef1313
Copy link
Member

Fixes#47987

Counting implicit object creations was depending on whether the whole documentcontains any implicit object creations or not.
That caused normal object creations to count as implicit when the document contains implicit creations. So, the normal object creations were counted twice.

alrz reacted with heart emoji
@Youssef1313Youssef1313 requested a review froma team as acode ownerOctober 8, 2020 13:07
voidCollectMatchingReferences(ISymboloriginalUnreducedSymbolDefinition,SyntaxNodenode,
ISyntaxFactsServicesyntaxFacts,ISemanticFactsServicesemanticFacts,ArrayBuilder<FinderLocation>locations)
{
if(syntaxFacts.IsImplicitObjectCreation(node))
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@jcouv In

https://github.com/dotnet/roslyn/pull/43645/files#diff-aeace626a93e2448b1aec4bc466c9931R336-R337

I see you introduced an extension method called "IsImplicitObjectCreationExpression". So I'm not sure whether I should useIsImplicitObjectCreation instance method, orIsImplicitObjectCreationExpression, and why we need the two?

Copy link
MemberAuthor

@Youssef1313Youssef1313 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The methodFindReferencesInImplicitObjectCreationExpressionAsync is currently inAbstractReferenceFinder.cs. I think it makes more sense to move it as a private method toConstructorSymbolReferenceFinder.cs.

I can't see a reason why to make it inAbstractReferenceFinder while its friend is inConstructorSymbolReferenceFinder:

privatestaticValueTask<ImmutableArray<FinderLocation>>FindOrdinaryReferencesAsync(

If you agree, I'll fix that.

Copy link
MemberAuthor

@Youssef1313Youssef1313 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Note 2:

FindReferencesInImplicitObjectCreationExpressionAsync currently returns aTask, whileFindOrdinaryReferencesAsync returns aValueTask.

I'm not sure if there is a performance benefit if both are returning aValueTask. It worth having a look.

@sharwell
Copy link
Contributor

sharwell commentedOct 8, 2020
edited
Loading

Blocked on#48401 that we are taking for 16.8. Keeping this PR open since the test is still helpful.

@Youssef1313
Copy link
MemberAuthor

@sharwell Do I need to retarget the PR to 16.8 branch?

@sharwell
Copy link
Contributor

sharwell commentedOct 8, 2020
edited
Loading

@Youssef1313 No we can keep the test in the master branch. I was fixing a performance issue for 16.8 and it just happens to have the same root cause as this. However, if youwant to retarget this to release/dev16.8 after my change merges, that would likely be acceptable as a test-only change.

@Youssef1313
Copy link
MemberAuthor

Youssef1313 commentedOct 8, 2020
edited
Loading

No we can keep the test in the master branch.

@sharwell Thanks. I'm keeping it in master.

There does seem to be test failures here related to the FAR feature. Can you please re-run the failed job to see whether it's a consistent failure or just flaky? (I'd be surprised if it's a consistent failure because these tests didn't fail in your PR)

I can't currently debug this because of some weird errors I'm getting in Visual Studio:

image

I tried to restart Visual Studio a couple of times, but every time I just get a different weird error like:

image

@CyrusNajmabadi
Copy link
Member

Already has PR to fix in:#48402 :)

Copy link
Member

@CyrusNajmabadiCyrusNajmabadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for the PR, however this is something Sam and I already have fixes for.#48402

Sorry for any time wasted.

@Youssef1313
Copy link
MemberAuthor

@CyrusNajmabadi No problem at all! Closing as duplicate.

@Youssef1313Youssef1313 deleted the target-typed-new-ctor-counting branchOctober 8, 2020 15:48
@jinujosephjinujoseph added Area-IDE CommunityThe pull request was submitted by a contributor who is not a Microsoft employee. labelsOct 8, 2020
@Youssef1313Youssef1313 restored the target-typed-new-ctor-counting branchOctober 10, 2020 15:45
@Youssef1313
Copy link
MemberAuthor

The bug is already fixed, but I re-opened to add the test to prevent regressions while refactoring in the future.

@Youssef1313
Copy link
MemberAuthor

Youssef1313 commentedOct 10, 2020
edited
Loading

Blocked on#48401 that we are taking for 16.8. Keeping this PR open since the test is still helpful.

@sharwell This is no longer blocked as your PR is now merged.

@jcouvjcouv added the Feature - Target-Typed New`new (args)` gets the created type inferred from context labelOct 15, 2020
@Youssef1313
Copy link
MemberAuthor

@CyrusNajmabadi This is a test only change. Can you please review?

@sharwellsharwell dismissedCyrusNajmabadi’sstale reviewNovember 8, 2020 18:46

This has been reduced to a test-only change

@sharwellsharwell merged commit11e3b9e intodotnet:masterNov 8, 2020
@ghostghost added this to theNext milestoneNov 8, 2020
@Youssef1313Youssef1313 deleted the target-typed-new-ctor-counting branchNovember 8, 2020 19:19
@allisonchouallisonchou modified the milestones:Next,16.9.P2Nov 24, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@CyrusNajmabadiCyrusNajmabadiCyrusNajmabadi left review comments

+1 more reviewer

@sharwellsharwellsharwell approved these changes

Reviewers whose approvals may not affect merge requirements

Labels

Area-IDEBlockedCommunityThe pull request was submitted by a contributor who is not a Microsoft employee.Feature - Target-Typed New`new (args)` gets the created type inferred from context

Projects

None yet

Milestone

16.9.P2

Development

Successfully merging this pull request may close these issues.

Target typed new - bug with constructor reference counting

6 participants

@Youssef1313@sharwell@CyrusNajmabadi@jinujoseph@jcouv@allisonchou

[8]ページ先頭

©2009-2025 Movatter.jp