Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 8, 2026

Description

Removed the GetFullName(this DefType metadataType) extension method from TypeSystemHelpers.cs and replaced its single usage in EcmaType.cs with ThrowHelper.ThrowTypeLoadException(this).

Changes:

  • EcmaType.cs: Replaced throw new TypeSystemException.TypeLoadException(ExceptionStringID.ClassLoadGeneral, GetFullName()) with ThrowHelper.ThrowTypeLoadException(this)
  • TypeSystemHelpers.cs: Deleted the DefType-specific GetFullName extension method (lines 100-108)

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

Remove all usages of the GetFullName(DefType) extension method and delete its definition from the codebase:

  1. In src/coreclr/tools/Common/TypeSystem/Common/TypeSystemHelpers.cs, locate and delete the extension method 'GetFullName(this DefType metadataType)'.
  2. Remove all existing calls to this extension variant throughout the repo.
  3. For the use in src/coreclr/tools/Common/TypeSystem/Common/Ecma/EcmaType.cs, replace the use of GetFullName(this DefType) with ThrowHelper.ThrowTypeLoadException(this).

Ensure only the DefType variant is removed and other GetFullName overloads/variants remain intact. Confirm that references you remove are specifically to the DefType method.

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.

Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove GetFullName extension method for DefType Remove GetFullName(DefType) extension method and replace usage Jan 8, 2026
Copilot AI requested a review from MichalStrehovsky January 8, 2026 07:52
@MichalStrehovsky MichalStrehovsky marked this pull request as ready for review January 8, 2026 12:09
Copilot AI review requested due to automatic review settings January 8, 2026 12:09
Copy link
Contributor

Copilot AI left a 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)

@MichalStrehovsky
Copy link
Member

@eduardo-vp could you have a look? This is related to the UTF-8 conversions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants