Commit f40f00d
authored
Chore :: Remove #IF NULLABLE, MaybeNull and other leftovers from bootstrap times of Nullable feature (#19235)
* Create TASKLIST.md
* Remove BUILDING_WITH_LKG conditionals from FSharp.Core
Remove all #if BUILDING_WITH_LKG || BUILD_FROM_SOURCE conditionals from
prim-types.fsi (7 blocks), prim-types.fs (2 blocks), event.fsi (2 blocks),
and event.fs (2 blocks).
For each block, kept the #else branch which includes:
- IsError=true in CompilerMessage attributes (prim-types.fsi)
- 'not null' type constraints on delegate types (all files)
These conditionals were only needed during F# 9 development when the
shipped .NET SDK didn't yet understand NRT. Now that NRT is stable,
this code can be unconditionally included.
* Replace MaybeNull usages with 'T | null in Compiler/Utilities
- Update NullnessShims.fs: nullSafeEquality and NonEmptyString now use 'T | null
- Update lib.fs/fsi: dispose and DisposablesTracker.Register use 'T | null
- Update illib.fs: reportTime and DelayInitArrayMap use nullable types
- Update FileSystem.fs: isInvalidPath/Filename/Directory use pattern matching
- Update Activity.fs: escapeStringForCsv and appendWithLeadingComma use nullable
- Update Cancellable.fs: Using member uses _ | null
- Update LruCache.fs: removeCollected uses nullable LinkedListNode
- Minor formatting fix in event.fs (fantomas)
Note: Cancellable.fsi retains MaybeNull in signature for backwards compatibility
with consuming code (changing it causes FS3261 nullness errors downstream).
The MaybeNull type alias is kept in NullnessShims.fs for this purpose.
* Replace MaybeNull usages with 'T | null in FSharp.Build
Replace all MaybeNull<'T> usages with the canonical 'T | null syntax in
FSharp.Build implementation files:
- Fsc.fs: 33 replacements
- Fsi.fs: 11 replacements
- FSharpCommandLineBuilder.fs: 2 method signature replacements
- WriteCodeFragment.fs: 2 replacements
The MaybeNull type definition is retained for backward compatibility.
Type annotations added to match expressions returning null to ensure
proper type inference with nullable types.
* Remove unused (^) operator and cleanup MaybeNull type alias
- Remove unused MaybeNull type alias definition from FSharpCommandLineBuilder.fs
- Remove unused (^) null-propagation operator from NullnessShims.fs
- Inline (^) usage in fsi.fs with direct null check pattern
- All FSharp.Build files now use 'T | null syntax directly
* Cleanup NULLABLE guarded leftovers
* Delete TASKLIST.md1 parent 7172d27 commit f40f00d
File tree
48 files changed
+262
-320
lines changed- src
- Compiler
- AbstractIL
- Checking
- CodeGen
- DependencyManager
- Driver
- Facilities
- Interactive
- Service
- TypedTree
- Utilities
- FSharp.Build
- FSharp.Core
- FSharp.DependencyManager.Nuget
- vsintegration
- src/FSharp.VS.FSI
- tests
- Salsa
- UnitTests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
48 files changed
+262
-320
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | | - | |
| 553 | + | |
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| |||
697 | 697 | | |
698 | 698 | | |
699 | 699 | | |
700 | | - | |
| 700 | + | |
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
| |||
1013 | 1013 | | |
1014 | 1014 | | |
1015 | 1015 | | |
1016 | | - | |
| 1016 | + | |
1017 | 1017 | | |
1018 | 1018 | | |
1019 | 1019 | | |
| |||
1102 | 1102 | | |
1103 | 1103 | | |
1104 | 1104 | | |
1105 | | - | |
| 1105 | + | |
1106 | 1106 | | |
1107 | 1107 | | |
1108 | 1108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1871 | 1871 | | |
1872 | 1872 | | |
1873 | 1873 | | |
1874 | | - | |
| 1874 | + | |
1875 | 1875 | | |
1876 | 1876 | | |
1877 | 1877 | | |
| |||
1881 | 1881 | | |
1882 | 1882 | | |
1883 | 1883 | | |
1884 | | - | |
1885 | | - | |
| 1884 | + | |
| 1885 | + | |
1886 | 1886 | | |
1887 | 1887 | | |
1888 | 1888 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
| 344 | + | |
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
397 | | - | |
| 396 | + | |
| 397 | + | |
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12194 | 12194 | | |
12195 | 12195 | | |
12196 | 12196 | | |
12197 | | - | |
| 12197 | + | |
12198 | 12198 | | |
12199 | 12199 | | |
12200 | 12200 | | |
| |||
0 commit comments