Skip to content

Conversation

@h3xds1nz
Copy link
Member

@h3xds1nz h3xds1nz commented Jan 11, 2025

Fixes #10285

Description

Analyzer fix, converts occurrences of typeof(Foo).Name to the compile-time generated nameof(Foo) alternative.

Customer Impact

Cleaner codebase, impact is negligible perf-wise as its exception cases.

Regression

No.

Testing

Local build.

Risk

Minimal.

Microsoft Reviewers: Open in CodeFlow

@h3xds1nz h3xds1nz requested review from a team as code owners January 11, 2025 20:53
@dotnet-policy-service dotnet-policy-service bot added PR metadata: Label to tag PRs, to facilitate with triage Community Contribution A label for all community Contributions labels Jan 11, 2025
@h3xds1nz h3xds1nz changed the title [Cleanup] Convert typeof(Foo).Name to nameof(Foo) (IDE0082) [StyleCleanUp] Convert typeof(Foo).Name to nameof(Foo) (IDE0082) Jan 15, 2025
@himgoyalmicro himgoyalmicro self-assigned this Jan 30, 2025
@h3xds1nz
Copy link
Member Author

@himgoyalmicro Fixed merge conflict :)

@h3xds1nz
Copy link
Member Author

That's unfortunate, this PR will have to wait until this flows in due to the implementation of nameof for unbound generics: dotnet/roslyn#76920

tl;dr the failure is not real, those two generate different results.

@himgoyalmicro
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@h3xds1nz
Copy link
Member Author

h3xds1nz commented Feb 8, 2025

@himgoyalmicro Once dotnet/sdk#46195 is merged and the SDK flows in, it will work. For now we gotta wait.

@h3xds1nz
Copy link
Member Author

@himgoyalmicro It builds now, the new SDK flowed in but of course #10514 broke the test runs now haha.

@ThomasGoulet73
Copy link
Contributor

@himgoyalmicro It builds now, the new SDK flowed in but of course #10514 broke the test runs now haha.

I have a fix ready that I'll push soon. This was caused by the switch from xUnit test runner to VSTest test runner introduced in #10514 which changed the order in which test were ran and exposed an existing bug in the tests.

@ThomasGoulet73
Copy link
Contributor

@h3xds1nz: Just a ping to let you know that the test failures in this PR were fixed in main, pulling main should fix the failures.

@pchaurasia14
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@codecov
Copy link

codecov bot commented Feb 28, 2025

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@009ae5a). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #10266   +/-   ##
==========================================
  Coverage        ?   11.09255%           
==========================================
  Files           ?        3215           
  Lines           ?      648471           
  Branches        ?       71534           
==========================================
  Hits            ?       71932           
  Misses          ?      575450           
  Partials        ?        1089           
Flag Coverage Δ
Debug 11.09255% <0.00000%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

@himgoyalmicro himgoyalmicro left a comment

Choose a reason for hiding this comment

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

LGTM

@himgoyalmicro himgoyalmicro merged commit 2873221 into dotnet:main Feb 28, 2025
8 checks passed
@himgoyalmicro
Copy link
Contributor

Many thanks to @h3xds1nz for your relentless contributions. Your support is invaluable 😄

@h3xds1nz
Copy link
Member Author

@himgoyalmicro Way too sweet, thank you, happy to contribute :)

@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IDE0082: Convert typeof to nameof

5 participants