-
Notifications
You must be signed in to change notification settings - Fork 816
F# using try .. with .. inside sequence expression raises trimming warning on publish. #17356
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
Comments
Duplicate of #17355 |
@vzarytovskii I guess this is marked duplicate because fixing |
Probably not, since getting rid of lazy will mean it will be a substantial change and will need to be replaced with something to emulate it, which might have the same issue, which will need to be addressed. |
Ah, okay, good to know. I was thinking of something simple like let mutable sourceEnumerator : IEnumerator<'T> = null
let originalSource () =
if isNull sourceEnumerator then
sourceEnumerator <- source.GetEnumerator()
sourceEnumerator would be sufficient to replace But, if there's more to it, I can understand. Thanks for taking a look. |
Lazy is also thread safe, mutable variable and check aren't, so this also needed to be solved, so own replacement solution will quickly grow in complexity and size, as well as it will require significantly more testing to make sure its behaviour is as before in both single and miltithreaded scenarios. |
Got it! Thanks for the explanation! |
Sure, np, thanks for testing out different aspects of AOT and reporting those back! |
Discussed in #17323
Originally posted by @abklearnhere June 18, 2024
F# using
seq { try .. with .. }
raises trimming warning on publish. For example,I am creating an F#, .NET 8 (SDK 8.0.302) console app and publish as a single file with AOT, trimming. I run dotnet publish command as below:
This results in warning:
The
fsproj
file has following settings:The text was updated successfully, but these errors were encountered: