-
Notifications
You must be signed in to change notification settings - Fork 772
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
[WIP] [RFC FS-1060] Nullness checking #15181
base: main
Are you sure you want to change the base?
Conversation
@vzarytovskii @T-Gro I squahed this and also fixed a nasty bug with nullness inference that I spotted while walking through with Vlad on Thursday |
@vzarytovskii @T-Gro This is basically green now :) And much, much trimmed down, with some bugs fixed. I've also revised the TODO list to what would be needed for bringing into preview (It's possible we could even ship preview using the |
I'm going to take care of metadata part |
I came across an article about F# Nullness support . As someone who's eagerly awaiting Nullable types including reference types in F#, I want to thank you for this contributions. https://github.com/ken-okabe/vanfs?tab=readme-ov-file#nullable |
Merge main to feature/nullness
…and adds 1x unbox.
Fix issues for plain 'dotnet build Fsharp.Compiler.Service.sln`
* Ignore Nullness applied on structs (C# allows T? when when T is a struct) * Bigfix: Working with CLI events in Fsharp * Bugfix: Mutable binding initially assigned to null should not need type annotation * Solving `let mutable cache = null` via type inference * Enforcing TyparConstraint.IsReferenceType when WithNull type is used * Nullness-related constraint consistency * Bugfix for emitting Nullable attrs for C#
Merge main to feature/nullness
Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
Thank you for kind words. We hoped to release it earlier, but feature turned out to be much more complex and big than we anticipated :( |
Continuation of #5790 and #6804
This is a prototype implementation of RFC FS-1060 nullable reference types
See tests\adhoc\nullness for testing and samples including baselines of outputs from
/langversion:preview
/langversion:preview /checknulls
TODO:
string | null
and: not null
(@T-Gro )Import+Export
TODOs (to test and adjust if needed)System.Collections.Generic.List<string | null>
)The types 'System.String (...)' and 'System.String (...)' do not have compatible nullability.
which is wrong - either the nullability aren't shown for some reason or the types should be considered compatibleTesting:
To be moved to RFC and resolved, then tested here:
if x then null else ""
andif x then "" else null