-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Remove GetFullName(DefType) extension method and replace usage #123001
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR removes an unused extension method and consolidates error handling to use a standard helper method. The DefType-specific GetFullName extension method is deleted from TypeSystemHelpers.cs, and its single usage in EcmaType.cs is replaced with a call to ThrowHelper.ThrowTypeLoadException.
- Removed the
GetFullName(this DefType metadataType)extension method from TypeSystemHelpers.cs - Replaced the exception throw in EcmaType.cs with a standardized ThrowHelper call
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.cs | Updated exception throwing to use ThrowHelper.ThrowTypeLoadException(this) instead of manually constructing TypeLoadException with GetFullName() |
| src/coreclr/tools/Common/TypeSystem/Common/TypeSystemHelpers.cs | Removed the DefType-specific GetFullName extension method (lines 160-167 in the new version) |
|
@eduardo-vp could you have a look? This is related to the UTF-8 conversions. |
Description
Removed the
GetFullName(this DefType metadataType)extension method from TypeSystemHelpers.cs and replaced its single usage in EcmaType.cs withThrowHelper.ThrowTypeLoadException(this).Changes:
throw new TypeSystemException.TypeLoadException(ExceptionStringID.ClassLoadGeneral, GetFullName())withThrowHelper.ThrowTypeLoadException(this)Other GetFullName overloads for TypeDesc, FieldDesc, and MethodDesc remain unchanged.
Customer Impact
None. Internal refactoring only.
Regression
No. This is a code cleanup change.
Testing
Built CoreCLR tools successfully with
./build.sh clr.Risk
Low. Single-line usage replacement with existing helper method. No functional change to error handling behavior.
Original prompt
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.