-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add trim analysis for implicit constructors #118755
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
Conversation
There was a problem hiding this 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 adds trim analysis for implicit constructors to address issue #106796. The change ensures that when a class inherits from another class with RequiresUnreferencedCode annotations, the analyzer properly detects and warns about the implicit constructor call to the base class constructor.
Key changes:
- Enhanced the RequiresUnreferencedCodeAnalyzer to analyze implicit base constructor calls
- Added test case updates to verify the new analysis behavior with expected warnings
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| RequiresUnreferencedCodeAnalyzer.cs | Added analysis logic for implicit base constructor calls in derived classes |
| RequiresOnClass.cs | Added expected warnings and instantiation calls for test consistency between analyzer and trimmer |
| RequiresExcludeStatics.cs | Added expected warning for implicit base constructor call |
src/tools/illink/src/ILLink.RoslynAnalyzer/RequiresUnreferencedCodeAnalyzer.cs
Outdated
Show resolved
Hide resolved
src/tools/illink/src/ILLink.RoslynAnalyzer/RequiresUnreferencedCodeAnalyzer.cs
Outdated
Show resolved
Hide resolved
|
Tagging subscribers to this area: @dotnet/illink |
This was warning on the implicit ctor.
|
/ba-g failures are unrelated |
|
@sbomer I assume you were hoping to get this into 10? |
|
/backport to release/10.0-rc1 |
|
Started backporting to release/10.0-rc1: https://github.com/dotnet/runtime/actions/runs/17047926123 |
Fixes #106796