Skip to content

Conversation

eduherminio
Copy link
Member

@eduherminio eduherminio commented Oct 9, 2025

Alt impls:

  • Returning returnType.Name would return Void, Object, Int32 instead of void, object and int.
  • Removing SymbolDisplayFormat.MinimallyQualifiedFormat would return the fully qualified name (i.e. Namespace.OuterClass.InnerClass).

Fixes #6719

Microsoft Reviewers: Open in CodeFlow

@eduherminio eduherminio marked this pull request as ready for review October 9, 2025 16:48
@eduherminio eduherminio requested a review from a team as a code owner October 9, 2025 16:48
@Copilot Copilot AI review requested due to automatic review settings October 9, 2025 16:48
Copy link
Contributor

@Copilot 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 fixes the METGEN004 error message to include the actual return type when reporting invalid method return types in the metrics generator. The change improves diagnostics by displaying the problematic return type (e.g., void, object, int) instead of just the method name.

  • Updates error diagnostic to show the return type using minimally qualified format
  • Adds test coverage to verify the error message includes the return type

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Generators/Microsoft.Gen.Metrics/Parser.cs Modified error diagnostic to include return type in message instead of method name
test/Generators/Microsoft.Gen.Metrics/Unit/ParserTests.cs Added test assertion to verify error message contains the return type

@eduherminio eduherminio merged commit aead2b6 into dotnet:main Oct 13, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong parameter in METGEN004 ErrorInvalidMethodReturnType diagnostic

2 participants