feat(AOT): Annotate Create with RequiresDynamicCode / RequiresUnreferencedCode#314
Open
dimension-zero wants to merge 1 commit into
Open
feat(AOT): Annotate Create with RequiresDynamicCode / RequiresUnreferencedCode#314dimension-zero wants to merge 1 commit into
dimension-zero wants to merge 1 commit into
Conversation
…encedCode
* New file TrimAnnotations.fs: internal polyfills in
System.Diagnostics.CodeAnalysis for RequiresDynamicCodeAttribute and
RequiresUnreferencedCodeAttribute. The trimmer and AOT compiler
resolve attributes by full type name, so internal copies in this
assembly are picked up. Guarded with #if !NET7_0_OR_GREATER so a
future multi-target picks up the real BCL attributes.
* ArgumentParser.fs:
- Add module TrimMessages with constant explanatory strings.
- Annotate ArgumentParser.Create<'Template> with both attributes so
AOT-publish consumers see IL3050 and trim-publish consumers see
IL2026, each with a clear message pointing at the underlying
reflection use (MakeGenericType / Activator / FSharpType).
* Argu.fsproj: set IsTrimmable=true and IsAotCompatible=false guarded
with MSBuild IsTargetFrameworkCompatible('net8.0') so netstandard2.0
builds still succeed without NETSDK1212 noise. A future multi-target
pass to net8.0 will activate these flags automatically.
Pure metadata addition. No runtime impact. All 112 tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(AOT): Annotate Create with RequiresDynamicCode / RequiresUnreferencedCode
System.Diagnostics.CodeAnalysis for RequiresDynamicCodeAttribute and
RequiresUnreferencedCodeAttribute. The trimmer and AOT compiler
resolve attributes by full type name, so internal copies in this
assembly are picked up. Guarded with #if !NET7_0_OR_GREATER so a
future multi-target picks up the real BCL attributes.
AOT-publish consumers see IL3050 and trim-publish consumers see
IL2026, each with a clear message pointing at the underlying
reflection use (MakeGenericType / Activator / FSharpType).
with MSBuild IsTargetFrameworkCompatible('net8.0') so netstandard2.0
builds still succeed without NETSDK1212 noise. A future multi-target
pass to net8.0 will activate these flags automatically.
Pure metadata addition. No runtime impact. All 112 tests pass.