Skip to content
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

Code generated from proto file has conflict with object.Equals() #1962

Closed
victlu opened this issue Apr 6, 2021 · 2 comments
Closed

Code generated from proto file has conflict with object.Equals() #1962

victlu opened this issue Apr 6, 2021 · 2 comments
Labels
enhancement New feature or request metrics Metrics signal related Stale Issues and pull requests which have been flagged for closing due to inactivity

Comments

@victlu
Copy link
Contributor

victlu commented Apr 6, 2021

Using grpc.tools to generate c# code for proto message MetricConfigResponse.Schedule.Pattern results in compiler conflict on object.Equals(object?).

C:\Users\Victor\src\victlu-opentelemetry-dotnet\test\Benchmarks-Proto\obj\Debug\net5.0\opentelemetry\proto\metrics\experimental\MetricsConfigService.cs(846,27): warning CS0108: 'MetricConfigResponse.Types.Schedule.Types.Pattern.Equals' hides inherited member 'object.Equals(object?)'. Use the new keyword if hiding was intended. [C:\Users\Victor\src\victlu-opentelemetry-dotnet\test\Benchmarks-Proto\protobench.csproj]
C:\Users\Victor\src\victlu-opentelemetry-dotnet\test\Benchmarks-Proto\obj\Debug\net5.0\opentelemetry\proto\metrics\experimental\MetricsConfigService.cs(888,34): error CS0102: The type 'MetricConfigResponse.Types.Schedule.Types.Pattern' already contains a definition for 'Equals' [C:\Users\Victor\src\victlu-opentelemetry-dotnet\test\Benchmarks-Proto\protobench.csproj]
C:\Users\Victor\src\victlu-opentelemetry-dotnet\test\Benchmarks-Proto\obj\Debug\net5.0\opentelemetry\proto\metrics\experimental\MetricsConfigService.cs(893,25): error CS0102: The type 'MetricConfigResponse.Types.Schedule.Types.Pattern' already contains a definition for 'Equals' [C:\Users\Victor\src\victlu-opentelemetry-dotnet\test\Benchmarks-Proto\protobench.csproj]

In file proto\metrics\experimental\metrics_config_service.proto the string equals = 1 in the following message is the root cause:

    message Pattern {
      oneof match {
        string equals = 1;       // matches the metric name exactly
        string starts_with = 2;  // prefix-matches the metric name
      }
    }

Options:

  • Ask SIG to rename equals to something else
  • Remove this proto file since it's in experimental folder
  • Try to look for config/settings for grpc.tool to remap this field
@victlu victlu added the bug Something isn't working label Apr 6, 2021
@victlu victlu added enhancement New feature or request metrics Metrics signal related and removed bug Something isn't working labels Apr 27, 2021
@cijothomas
Copy link
Member

@alanwest can you confirm if we can close this issue ? we dont use experimental protos anyway?

Copy link
Contributor

This issue was marked stale due to lack of activity and will be closed in 7 days. Commenting will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions bot added the Stale Issues and pull requests which have been flagged for closing due to inactivity label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request metrics Metrics signal related Stale Issues and pull requests which have been flagged for closing due to inactivity
Projects
None yet
Development

No branches or pull requests

3 participants