Skip to content
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

Bugfix :: Nullness :: Add warnings for instantiations of (T|null) which are not allowed in F# (frequent at Deserialize from S.T.Json) #18057

Conversation

T-Gro
Copy link
Member

@T-Gro T-Gro commented Nov 25, 2024

Description

This adds a missing waring in case of disallowed generic instantiations for code in C# that uses (T|null) for uncostrained generic, therefore making it possible to make |null out of tuples, anons, structs or units of measure.

These types cannot carry a nullness information at the type system level in F#, and therefore subsequent checks for nullness stop working.

This PR adds a warning when such method is used with a type disallowing nullness qualifier.

Fixes #17951

@T-Gro T-Gro requested a review from a team as a code owner November 25, 2024 15:50
Copy link
Contributor

github-actions bot commented Nov 25, 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.200.md

@T-Gro T-Gro added this to the November-2024 milestone Nov 25, 2024
@T-Gro T-Gro self-assigned this Nov 25, 2024
T-Gro and others added 3 commits November 26, 2024 11:58
src/Compiler/FSComp.txt Show resolved Hide resolved
…ble-generic-return-type-used-with-anonymous-record
@psfinaki psfinaki merged commit 935b796 into main Dec 4, 2024
33 checks passed
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 - No warning when nullable generic return type used with anonymous record
4 participants