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

Increase use of NotNullWhen polyfill #6090

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SimonCropp
Copy link
Contributor

Fixes #
Design discussion issue #

Changes

also allows us to remove some redundant ! null suppressions

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@SimonCropp SimonCropp requested a review from a team as a code owner January 23, 2025 05:04
@github-actions github-actions bot added pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package pkg:OpenTelemetry.Exporter.Zipkin Issues related to OpenTelemetry.Exporter.Zipkin NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package labels Jan 23, 2025
@SimonCropp SimonCropp changed the title leverage more NotNullWhen polyfill via an InternalsVIsibleTo Increase use of NotNullWhen polyfill Jan 23, 2025
@TimothyMothra
Copy link
Contributor

LGTM. You have conflicts with main and will need to update your branch

@SimonCropp
Copy link
Contributor Author

conflicts resolved

@@ -13,6 +13,7 @@
[assembly: InternalsVisibleTo("OpenTelemetry.Extensions.Hosting" + AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("OpenTelemetry.Extensions.Hosting.Tests" + AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("OpenTelemetry.Tests" + AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("OpenTelemetry.Api.Tests" + AssemblyInfo.PublicKey)]
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem logically sound—an implementation exposing its internal details to the API. I understand it's intended for a test project, but it's better to avoid this approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rajkumar-rangaraj how is this different than the internalsvsiible to for OpenTelemetry.Extensions.Hosting.Tests, OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests, OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests, and OpenTelemetry.Extensions.Hosting.Tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package pkg:OpenTelemetry.Exporter.Zipkin Issues related to OpenTelemetry.Exporter.Zipkin NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants