Skip to content

Conversation

@T-Gro
Copy link
Member

@T-Gro T-Gro commented Aug 13, 2024

F# option<> Has UseNullAsTrueValueAttribute on it, making the representation of None null in IL.
Therefore, even if the type is not considered null (assignment, pattern matching, ..) in F#, it must reported as nullable for C# consumers.
This can be also demonstrated at runtime by using the reflection helpers at NullabilityInfoContext (test added).

This covers all types marked as UseNullAsTrueValue as well as (~legacy, not recommended under --checknulls+) types marked with AllowNull.

@T-Gro T-Gro requested a review from a team as a code owner August 13, 2024 13:29
@github-actions
Copy link
Contributor

github-actions bot commented Aug 13, 2024

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/9.0.100.md

@T-Gro T-Gro linked an issue Aug 15, 2024 that may be closed by this pull request
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Nullness issue - Option<string> is marked as NotNull using NullabilityInfoContext

4 participants