Skip to content

[AOT] Resolve Trimming warnings in ActivityInstrumentationHelper #4513

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

Merged
merged 1 commit into from
May 22, 2023

Conversation

eerhardt
Copy link
Contributor

@eerhardt eerhardt commented May 22, 2023

The trimming tool can't tell which type Expression.Property(Expression, string propertyName) refers to, so it isn't able to preserve the referenced property.

The workaround is to explicitly reference the PropertyInfo from the static type, which the trimmer can see and knows to preserve the property.

Contributes to #3429

Merge requirement checklist

  • CONTRIBUTING guidelines followed (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)

The trimming tool can't tell which type Expression.Property(Expression, string propertyName) refers to, so it isn't able to preserve the referenced property.

The workaround is to explicitly reference the PropertyInfo from the static type, which the trimmer can see and knows to preserve the property.

Contributes to open-telemetry#3429
@eerhardt eerhardt requested a review from a team May 22, 2023 21:05
@codecov
Copy link

codecov bot commented May 22, 2023

Codecov Report

Merging #4513 (2afaee3) into main (30ad91a) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4513      +/-   ##
==========================================
+ Coverage   85.13%   85.17%   +0.03%     
==========================================
  Files         316      316              
  Lines       12581    12583       +2     
==========================================
+ Hits        10711    10717       +6     
+ Misses       1870     1866       -4     
Impacted Files Coverage Δ
...elemetry/Internal/ActivityInstrumentationHelper.cs 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

@utpilla utpilla merged commit f4f4469 into open-telemetry:main May 22, 2023
@eerhardt eerhardt deleted the FixActivityExpressions branch May 22, 2023 23:01
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