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

[RFC FS-1060] Nullness checking (applied to codebase) #15310

Merged
merged 303 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
303 commits
Select commit Hold shift + click to select a range
ef15719
fantomas
T-Gro Nov 29, 2023
f230a6f
fix tests
T-Gro Nov 30, 2023
7ea37af
Merge branch 'main' into feature/nullness
T-Gro Nov 30, 2023
97a9c31
trim test
T-Gro Dec 1, 2023
51044a7
trimming test
T-Gro Dec 1, 2023
7182913
trim check
T-Gro Dec 1, 2023
26de6fe
now?
T-Gro Dec 1, 2023
8f48a32
IL tests
T-Gro Dec 4, 2023
3f763a5
il tests
T-Gro Dec 4, 2023
cbfe777
trim test
T-Gro Dec 4, 2023
5e296b9
trim
T-Gro Dec 4, 2023
dec61d6
one more time
T-Gro Dec 4, 2023
91429b4
Merge main to feature/nullness (#16366)
dotnet-bot Dec 4, 2023
3f55d8d
Merge branch 'main' into feature/nullness
T-Gro Dec 4, 2023
73d670d
syntax tree layout
T-Gro Dec 4, 2023
4a19eb4
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Dec 5, 2023
4ef4815
Merge pull request #16383 from dotnet/merges/main-to-feature/nullness
T-Gro Dec 5, 2023
80efaa2
Nullness-related aggressive trimming of FSharp.Core (#16387)
T-Gro Dec 5, 2023
fe42158
Merge branch 'main' into feature/nullness
T-Gro Dec 5, 2023
3de7178
Merge branch 'main' into feature/nullness
T-Gro Dec 5, 2023
bf45dee
Merge main to feature/nullness (#16397)
dotnet-bot Dec 8, 2023
ed7854b
Merge branch 'main' into feature/nullness
T-Gro Dec 8, 2023
2bca3d8
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Jan 15, 2024
d697c63
Nullness interop - import of C#-emitted metadata (#16423)
T-Gro Jan 17, 2024
00a591c
Nullness - include in QuickInfo and in general in "typeEnc" (string r…
T-Gro Jan 23, 2024
38532af
Merge main to feature/nullness (#16539)
dotnet-bot Jan 24, 2024
ba6b0f2
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Jan 24, 2024
c022d5a
applying nullness to the codebase, part 1
T-Gro Jan 24, 2024
9caf7bc
Adjusting codebase
T-Gro Jan 25, 2024
10aa5a2
DelayInitArrayMap nullness
T-Gro Jan 25, 2024
e7f4f1f
conflicts resolved
T-Gro Jan 25, 2024
3c53e3b
release notes
T-Gro Jan 25, 2024
dfada6a
Merge branch 'main' into feature/nullness
T-Gro Jan 25, 2024
dac9c76
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Jan 25, 2024
5b792a0
fix NO_CHECKNULLS build
T-Gro Jan 25, 2024
71e209e
Update illib.fsi
T-Gro Jan 25, 2024
3250b7e
Fix ILType.Array import (#16585)
T-Gro Jan 25, 2024
cf735db
Merge branch 'main' into feature/nullness
T-Gro Jan 25, 2024
f73a1ff
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Jan 25, 2024
e0f1634
Nullness - reading+writing metadata for 'inherits' and interface imp…
T-Gro Jan 30, 2024
33e5e27
Merge branch 'main' into feature/nullness
T-Gro Jan 30, 2024
ca3366b
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Jan 30, 2024
d70d1fe
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
KevinRansom Jan 31, 2024
a2df473
Merge pull request #16620 from dotnet/merges/main-to-feature/nullness
KevinRansom Jan 31, 2024
60c4fb0
ILGenerator test case
T-Gro Jan 31, 2024
ca7e0b4
Merge branch 'feature/nullness' of https://github.com/dotnet/fsharp i…
T-Gro Jan 31, 2024
476d7ba
workaround a bug in ns20 API
T-Gro Jan 31, 2024
e3bfa71
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Jan 31, 2024
29462f2
Merge pull request #16635 from dotnet/merges/main-to-feature/nullness
T-Gro Feb 1, 2024
f30c6a0
Merge branch 'main' into feature/nullness
T-Gro Feb 1, 2024
1d86093
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Feb 1, 2024
d1035f1
applying nullness
T-Gro Feb 5, 2024
2c29f52
Merge branch 'revert-15309-revert-15265-feature/nullness-enabled' of …
T-Gro Feb 6, 2024
5811d88
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Feb 6, 2024
cd662eb
Merge pull request #16648 from dotnet/merges/main-to-feature/nullness
T-Gro Feb 6, 2024
2a43e53
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Feb 6, 2024
bca1c53
Nullness :: Format string %s should allow nullable string (#16656)
T-Gro Feb 6, 2024
836e2c9
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Feb 7, 2024
a35c0e2
Merge pull request #16660 from dotnet/merges/main-to-feature/nullness
T-Gro Feb 7, 2024
17f0ced
Nullness:: Unchecked.nonNull for FSharp.Core (#16654)
T-Gro Feb 7, 2024
a0cb6b4
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Feb 7, 2024
d4dd6a8
Merge branch 'main' into feature/nullness
T-Gro Feb 8, 2024
15b9962
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Feb 8, 2024
552ea0a
Merge branch 'main' into feature/nullness
T-Gro Feb 8, 2024
050c8a0
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Feb 8, 2024
fc5c6c4
Merge pull request #16679 from dotnet/merges/main-to-feature/nullness
KevinRansom Feb 9, 2024
c5ecfb4
Merge branch 'main' into feature/nullness
T-Gro Feb 9, 2024
53f5e8c
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Feb 9, 2024
3775088
Merge pull request #16685 from dotnet/merges/main-to-feature/nullness
KevinRansom Feb 10, 2024
17a5ca9
Nullness :: Pattern matching with null should mark input for subseque…
T-Gro Feb 12, 2024
9bc3f81
Merge branch 'main' into feature/nullness
T-Gro Feb 12, 2024
ec2d4a8
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Feb 13, 2024
b6b737f
Merge pull request #16694 from dotnet/merges/main-to-feature/nullness
T-Gro Feb 13, 2024
3754c86
Merge pull request #16705 from dotnet/merges/main-to-feature/nullness
KevinRansom Feb 14, 2024
bfd8520
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
KevinRansom Feb 16, 2024
ab8a943
Merge pull request #16722 from dotnet/merges/main-to-feature/nullness
T-Gro Feb 16, 2024
d487006
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Feb 17, 2024
0e3f43f
Merge pull request #16727 from dotnet/merges/main-to-feature/nullness
T-Gro Feb 17, 2024
49e0d7c
Merge pull request #16728 from dotnet/merges/main-to-feature/nullness
KevinRansom Feb 20, 2024
97d9437
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
KevinRansom Feb 23, 2024
6827b1c
Feature nullness - support overrides of nullness annotation in the im…
T-Gro Mar 4, 2024
552c843
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Mar 4, 2024
ba69485
Improve type inference w.r.t. nullness in printing (#16681)
T-Gro Mar 4, 2024
9ae3768
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
vzarytovskii Mar 4, 2024
e8f2b97
Update tests/AheadOfTime/Trimming/check.ps1
T-Gro Mar 4, 2024
1f2b43b
Merge pull request #16752 from dotnet/merges/main-to-feature/nullness
T-Gro Mar 4, 2024
5eb9fea
Merge branch 'main' into feature/nullness
T-Gro Mar 4, 2024
055c772
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Mar 5, 2024
654c27f
Merge pull request #16808 from dotnet/merges/main-to-feature/nullness
T-Gro Mar 5, 2024
806c58e
Merge branch 'main' into feature/nullness
T-Gro Mar 6, 2024
743996a
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Mar 11, 2024
171b69e
Merge branch 'main' into feature/nullness
T-Gro Mar 11, 2024
04b93e1
Fix merge errors
T-Gro Mar 11, 2024
b5b14b6
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Mar 11, 2024
cbaffad
Merge pull request #16840 from dotnet/merges/main-to-feature/nullness
T-Gro Mar 11, 2024
2071594
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Mar 13, 2024
3c5605c
il tests reflecting visibility change
T-Gro Mar 18, 2024
cb696d5
Merge pull request #16866 from dotnet/merges/main-to-feature/nullness
T-Gro Mar 18, 2024
14efaa4
Merge branch 'main' into feature/nullness
T-Gro Mar 18, 2024
72b7494
Nullness feature :: New warning for functions insisting on a (WithNul…
T-Gro Mar 19, 2024
74d1da2
Merge branch 'main' into feature/nullness
T-Gro Mar 19, 2024
ccc35ba
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Mar 21, 2024
8ff2ed1
Merge pull request #16915 from dotnet/merges/main-to-feature/nullness
T-Gro Mar 21, 2024
5d89ba3
Merge pull request #16930 from dotnet/merges/main-to-feature/nullness
KevinRansom Mar 22, 2024
b84d754
Merge pull request #16939 from dotnet/merges/main-to-feature/nullness
T-Gro Mar 25, 2024
7f502b7
Merge pull request #16949 from dotnet/merges/main-to-feature/nullness
T-Gro Mar 26, 2024
65c7b8b
Merge branch 'main' into feature/nullness
T-Gro Mar 26, 2024
55cd42f
Feature nullness - propper guards against ` | null ` on unsupported t…
T-Gro Mar 28, 2024
b34e568
Merge pull request #16960 from dotnet/merges/main-to-feature/nullness
T-Gro Apr 2, 2024
8801707
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Apr 2, 2024
0be7fb4
fantomas
T-Gro Apr 3, 2024
9e4a413
Null-safe activity module
T-Gro Apr 3, 2024
a638f34
assemblyresolvehandler - reflection APIs
T-Gro Apr 3, 2024
e022636
Decorating generic not null type parameters
T-Gro Apr 3, 2024
28eb39c
Conditionally adding net8.0 tfm to get better null annotations
T-Gro Apr 3, 2024
9cf47f4
asyncmemoize,cancellable
T-Gro Apr 3, 2024
faba56d
Merge pull request #16980 from dotnet/merges/main-to-feature/nullness
KevinRansom Apr 4, 2024
a2fb9dd
Compiler location
T-Gro Apr 5, 2024
0d7068c
Option.ofString
T-Gro Apr 5, 2024
a6be10c
Merge pull request #16989 from dotnet/merges/main-to-feature/nullness
T-Gro Apr 5, 2024
a871929
getting rid of explicit type annotations
T-Gro Apr 5, 2024
7090129
(!!) introduced, applied for `typeof<..>.FullName`
T-Gro Apr 5, 2024
25dd379
.ToString() can return null, `string` function handles this
T-Gro Apr 5, 2024
bb6ae59
e.InnerException safe handling
T-Gro Apr 5, 2024
3a1a352
compiler imports - !! on file system ops that are `NotNullIfNotNull`
T-Gro Apr 5, 2024
b8feeac
Merge pull request #16996 from dotnet/merges/main-to-feature/nullness
KevinRansom Apr 6, 2024
920cae8
compilerlocation
T-Gro Apr 8, 2024
d522550
some more
T-Gro Apr 8, 2024
4b9ff3d
nullArgCheck -> (!!) to match existing assumption
T-Gro Apr 8, 2024
dc8b9fd
dependency provider
T-Gro Apr 8, 2024
597e9d6
next batch
T-Gro Apr 8, 2024
3675157
next batch
T-Gro Apr 8, 2024
0e350af
Working around .ToString() overrides in F# side
T-Gro Apr 9, 2024
dc6dd0b
ilreflect
T-Gro Apr 9, 2024
9067ad6
Merge pull request #17007 from dotnet/merges/main-to-feature/nullness
T-Gro Apr 10, 2024
647d797
Merge pull request #17023 from dotnet/merges/main-to-feature/nullness
T-Gro Apr 11, 2024
387acf8
next batch, adding `defaultIfNull `
T-Gro Apr 11, 2024
bc8a27e
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Apr 12, 2024
4b955cd
nullSafeEquality added, bunch of files reworked
T-Gro Apr 12, 2024
58f8cac
Merge pull request #17037 from dotnet/merges/main-to-feature/nullness
T-Gro Apr 16, 2024
76d28e5
transparent compiler - apply !! to filepath ops
T-Gro Apr 16, 2024
a9f23ca
typedtree
T-Gro Apr 16, 2024
d3cf221
typeproviders,infos
T-Gro Apr 17, 2024
f25d792
infos,,ilwritepdb
T-Gro Apr 17, 2024
1f9d5e9
some more
T-Gro Apr 17, 2024
b5b3f0d
Merge pull request #17058 from dotnet/merges/main-to-feature/nullness
KevinRansom Apr 17, 2024
c1b53bc
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Apr 18, 2024
dc0eaea
next batch, compareBy added
T-Gro Apr 18, 2024
42c6afd
Merge pull request #17065 from dotnet/merges/main-to-feature/nullness
T-Gro Apr 18, 2024
d78f5aa
Feature nullness :: warn also for 'obj' type (since it can be infered…
T-Gro Apr 19, 2024
a2823f3
typedtreeops, IComparer and IEqualityComparer impls
T-Gro Apr 19, 2024
6f0875d
sformat
T-Gro Apr 19, 2024
a0a7d82
Merge branch 'main' into feature/nullness
T-Gro Apr 19, 2024
13e8af2
Nullness feature :: various bugfixes (#17080)
T-Gro Apr 26, 2024
3bcf33d
Merge pull request #17083 from dotnet/merges/main-to-feature/nullness
T-Gro Apr 26, 2024
71c6b58
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Apr 26, 2024
14d666e
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Apr 29, 2024
fed2bdb
Merge branch 'main' into merges/main-to-feature/nullness
T-Gro May 16, 2024
ebdeebc
updating IL tests
T-Gro May 16, 2024
f161691
One more try
T-Gro May 16, 2024
6cf326c
surface area
T-Gro May 17, 2024
e154438
Merge branch 'main' into merges/main-to-feature/nullness
T-Gro May 17, 2024
0b65db9
trimmed size
T-Gro May 17, 2024
176275f
Merge pull request #17097 from dotnet/merges/main-to-feature/nullness
T-Gro May 17, 2024
a6373c9
Merge branch 'merges/main-to-feature/nullness' of https://github.com/…
T-Gro May 20, 2024
817ee1e
trimmed size
T-Gro May 20, 2024
61f5777
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro May 20, 2024
03e294f
Merge pull request #17175 from dotnet/merges/main-to-feature/nullness
T-Gro May 20, 2024
7da45b5
fix issues for plain 'dotnet build Fsharp.Compiler.Service.sln`
T-Gro May 20, 2024
c28b21a
update FSharpCoreShippedPackageVersionValue
T-Gro May 20, 2024
3570b2f
Wkraround attributetargets issue by using 'obj'. This removes 3x box …
T-Gro May 20, 2024
13e50b4
Merge pull request #17185 from dotnet/feature-nullness-fix-plain-builds
T-Gro May 21, 2024
3d375d2
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro May 21, 2024
e2e698d
Feature nullness :: Bugfixes (#17102)
T-Gro May 21, 2024
165f664
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro May 21, 2024
3603443
Merge pull request #17192 from dotnet/merges/main-to-feature/nullness
T-Gro May 21, 2024
101ae03
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Jun 11, 2024
aa62eef
Automated command ran: fantomas
github-actions[bot] Jun 11, 2024
a72457e
Feature nullness :: Try infer without null even when function/method…
T-Gro Jun 11, 2024
d4ad891
Feature nullness :: apply nullness annotations to usages of 'obj' in …
T-Gro Jun 11, 2024
382a327
Merge pull request #17213 from dotnet/merges/main-to-feature/nullness
T-Gro Jun 11, 2024
f9b1ccc
Merge branch 'main' into feature/nullness
T-Gro Jun 12, 2024
d84326b
resolve build error from auto-merge
T-Gro Jun 12, 2024
64033b9
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Jun 17, 2024
d2d7bd3
Merge pull request #17304 from dotnet/merges/main-to-feature/nullness
T-Gro Jun 17, 2024
1b29d70
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Jun 17, 2024
7bde93c
Merge branch 'main' into feature/nullness
T-Gro Jun 17, 2024
5ab472e
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Jun 17, 2024
679f605
Merge pull request #17320 from dotnet/merges/main-to-feature/nullness
T-Gro Jun 18, 2024
4fbbf32
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Jun 19, 2024
5488a35
Feature nullness :: Cleanups, Test reorg, fix incrementalbuild cache …
T-Gro Jun 19, 2024
091da12
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Jun 19, 2024
23f9990
Got rid of errors, now only warnings remain - hopefully
T-Gro Jun 19, 2024
0bba083
Relaxing LKG definition of MaybeNull to make it work for List ( List …
T-Gro Jun 19, 2024
98458d0
applying to codebase
T-Gro Jun 22, 2024
da4cdd3
applying nullness
T-Gro Jun 24, 2024
c044f20
protobuild passing now
T-Gro Jun 24, 2024
e41ad14
Update fsc.fsproj
T-Gro Jun 24, 2024
a9e52a3
fantomas
T-Gro Jun 25, 2024
9abf120
fix build
T-Gro Jun 25, 2024
888995c
try skipping R2R
T-Gro Jun 25, 2024
0aa633f
Bootstraping for resource builds
T-Gro Jun 25, 2024
595412f
Fix plain build
T-Gro Jun 26, 2024
2cb5387
Merge branch 'main' into revert-15309-revert-15265-feature/nullness-e…
T-Gro Jun 26, 2024
107ee5c
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Jun 26, 2024
30b2a02
fix tests build
T-Gro Jun 26, 2024
dc92a0c
Merge pull request #17337 from dotnet/merges/main-to-feature/nullness
T-Gro Jun 26, 2024
1108c0d
fantomas
T-Gro Jun 26, 2024
0a8ee68
Moving changes off from Micosoft.FSharp.targets to local Directory bu…
T-Gro Jun 27, 2024
469899b
Merge branch 'merges/main-to-feature/nullness' of https://github.com/…
T-Gro Jul 1, 2024
24f923c
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Jul 1, 2024
c8cfda2
fix build issues
T-Gro Jul 1, 2024
653507c
Merge branch 'merges/main-to-feature/nullness' of https://github.com/…
T-Gro Jul 1, 2024
fedc901
Merge pull request #17354 from dotnet/merges/main-to-feature/nullness
T-Gro Jul 3, 2024
7ec905d
Merge branch 'main' into feature/nullness
T-Gro Jul 3, 2024
64c7e18
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Jul 3, 2024
1f2e0c4
resolve semantic merge error
T-Gro Jul 3, 2024
af3f704
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Jul 3, 2024
ddd666d
merge
KevinRansom Jul 9, 2024
59938f4
Merge pull request #17395 from KevinRansom/nullness
T-Gro Jul 9, 2024
a7984af
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Jul 9, 2024
49bec1c
Nullness subsumption when used for contravariant typars
T-Gro Jul 9, 2024
6a65374
Merge branch 'feature/nullness' into feature-nullness-variance
T-Gro Jul 9, 2024
30c3432
fix nullness plain build (#17404)
T-Gro Jul 11, 2024
0773645
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Jul 11, 2024
5f6b7da
Merge branch 'feature/nullness' into feature-nullness-variance
T-Gro Jul 11, 2024
3752733
Merge branch 'main' into feature/nullness
vzarytovskii Jul 11, 2024
57026b8
Merge pull request #17398 from dotnet/feature-nullness-variance
T-Gro Jul 11, 2024
5dcad11
Merge branch 'feature/nullness' into revert-15309-revert-15265-featur…
T-Gro Jul 11, 2024
770f98e
Merge branch 'main' into revert-15309-revert-15265-feature/nullness-e…
T-Gro Jul 19, 2024
e6f93a7
fix build issues after merge conflicts
T-Gro Jul 19, 2024
3a1b9ab
Fix release notes
psfinaki Jul 23, 2024
ee10bb3
Merge branch 'main' into revert-15309-revert-15265-feature/nullness-e…
T-Gro Jul 26, 2024
3e108fe
Change TargetFrameworks conditioning
T-Gro Jul 26, 2024
a72a20f
Resolving some TODOs, address fsharp.build artifacts and their nullne…
T-Gro Jul 26, 2024
48239d1
resolve TODOs in inforeader
T-Gro Jul 26, 2024
509e515
Our Range must shadow the System.Range which exists for ns2.1 and above
T-Gro Jul 26, 2024
bc6a20d
fantomas
T-Gro Jul 26, 2024
9c2e5e8
fantomas, readmes
T-Gro Jul 26, 2024
67667ce
Merge branch 'main' into revert-15309-revert-15265-feature/nullness-e…
T-Gro Jul 26, 2024
1b90861
F.C.S surface tests must use ns2.0 to make sure assembly references a…
T-Gro Jul 26, 2024
0284740
Merge branch 'main' into revert-15309-revert-15265-feature/nullness-e…
T-Gro Jul 29, 2024
1c08cd0
Merge branch 'main' into revert-15309-revert-15265-feature/nullness-e…
T-Gro Jul 31, 2024
3aa57a2
Skip NetCurrent on OSX CI
T-Gro Jul 31, 2024
677ce2f
Skip NetCurrent Linux as well, I think machine provisioning makes it …
T-Gro Jul 31, 2024
8717723
Merge branch 'main' into revert-15309-revert-15265-feature/nullness-e…
T-Gro Aug 12, 2024
5020a50
Re-enable PublishReadyToRun for fsc
T-Gro Aug 13, 2024
0b5cf85
Merge branch 'main' into revert-15309-revert-15265-feature/nullness-e…
T-Gro Aug 13, 2024
1efd639
put fsc.fscproj back
T-Gro Aug 13, 2024
02d9d23
Merge branch 'main' into revert-15309-revert-15265-feature/nullness-e…
T-Gro Aug 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .fantomasignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,23 @@ src/FSharp.Core/Query.fs
src/FSharp.Core/seqcore.fs


# fsharp (to investigate)

**/TypeProviders.fsi
**/tainted.fsi

# uses nullness features

**/DependencyProvider.fsi
src/FSharp.Core/array.fs
src/FSharp.Core/option.fsi
src/FSharp.Core/option.fs
src/fsi/console.fs
src/FSharp.Build/FSharpCommandLineBuilder.fs
src/Compiler/Utilities/sformat.fs
src/Compiler/Utilities/illib.fsi
src/Compiler/Utilities/illib.fs

# Fantomas limitations on implementation files (to investigate)

src/Compiler/AbstractIL/ilwrite.fs
Expand Down
30 changes: 30 additions & 0 deletions FSharp.Profiles.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
<Project>
<PropertyGroup>
<!-- This turns on/off the use of the feature within the codebase -->
<!-- The default is off - it is selectively enabled -->
<CheckNulls Condition="'$(CheckNulls)' == ''">false</CheckNulls>
</PropertyGroup>

<PropertyGroup Condition="'$(FSHARPCORE_USE_PACKAGE)' == 'true'">
<!-- nullness checking isn't possible when using shipped FSharp.Core package until it's updated -->
<CheckNulls>false</CheckNulls>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Proto'">
<CheckNulls>false</CheckNulls>
<DefineConstants>NO_CHECKNULLS;BUILDING_WITH_LKG;NO_NULLCHECKING_LIB_SUPPORT;$(DefineConstants)</DefineConstants>
<NullCheckingSupportInLibrary>false</NullCheckingSupportInLibrary>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' != 'Proto'">
<OtherFlags>$(OtherFlags) /langversion:preview</OtherFlags>
</PropertyGroup>

<PropertyGroup Condition="'$(CheckNulls)' == 'true'">
<OtherFlags>$(OtherFlags) /checknulls</OtherFlags>
</PropertyGroup>

<PropertyGroup Condition="'$(CheckNulls)' == 'false'">
<!-- 3271: warning nullness annotations being ignored -->
<NoWarn>$(NoWarn);3271</NoWarn>
<DefineConstants>NO_CHECKNULLS;$(DefineConstants)</DefineConstants>
</PropertyGroup>

<Choose>
<When Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' ">
Expand Down
5 changes: 1 addition & 4 deletions FSharpBuild.Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,9 @@
</PropertyGroup>

<!-- use this to enable good debugging in the Proto bootstrap compiler -->
<!-- You'll have to remove it to get the actual compiler bo build because optimization is needed for some large methods -->
<!--
<PropertyGroup Condition="'$(Configuration)' == 'Proto'">
<PropertyGroup Condition="'$(ProtoDebug)' == 'true'">
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<Tailcalls>true</Tailcalls>
</PropertyGroup>
-->
</Project>
15 changes: 15 additions & 0 deletions VisualFSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Editor.Tests", "vsin
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FSharp.Editor.IntegrationTests", "vsintegration\tests\FSharp.Editor.IntegrationTests\FSharp.Editor.IntegrationTests.csproj", "{E31F9B59-FCF1-4D04-8762-C7BB60285A7B}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "nullness", "tests\adhoc\nullness\nullness.fsproj", "{6992D926-AB1C-4CD4-94D5-0319D14DB54B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1033,6 +1035,18 @@ Global
{E31F9B59-FCF1-4D04-8762-C7BB60285A7B}.Release|Any CPU.Build.0 = Release|Any CPU
{E31F9B59-FCF1-4D04-8762-C7BB60285A7B}.Release|x86.ActiveCfg = Release|Any CPU
{E31F9B59-FCF1-4D04-8762-C7BB60285A7B}.Release|x86.Build.0 = Release|Any CPU
{6992D926-AB1C-4CD4-94D5-0319D14DB54B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6992D926-AB1C-4CD4-94D5-0319D14DB54B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6992D926-AB1C-4CD4-94D5-0319D14DB54B}.Debug|x86.ActiveCfg = Debug|Any CPU
{6992D926-AB1C-4CD4-94D5-0319D14DB54B}.Debug|x86.Build.0 = Debug|Any CPU
{6992D926-AB1C-4CD4-94D5-0319D14DB54B}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
{6992D926-AB1C-4CD4-94D5-0319D14DB54B}.Proto|Any CPU.Build.0 = Debug|Any CPU
{6992D926-AB1C-4CD4-94D5-0319D14DB54B}.Proto|x86.ActiveCfg = Debug|Any CPU
{6992D926-AB1C-4CD4-94D5-0319D14DB54B}.Proto|x86.Build.0 = Debug|Any CPU
{6992D926-AB1C-4CD4-94D5-0319D14DB54B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6992D926-AB1C-4CD4-94D5-0319D14DB54B}.Release|Any CPU.Build.0 = Release|Any CPU
{6992D926-AB1C-4CD4-94D5-0319D14DB54B}.Release|x86.ActiveCfg = Release|Any CPU
{6992D926-AB1C-4CD4-94D5-0319D14DB54B}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1114,6 +1128,7 @@ Global
{FE23BB65-276A-4E41-8CC7-F7752241DEBA} = {39CDF34B-FB23-49AE-AB27-0975DA379BB5}
{CBC96CC7-65AB-46EA-A82E-F6A788DABF80} = {F7876C9B-FB6A-4EFB-B058-D6967DB75FB2}
{E31F9B59-FCF1-4D04-8762-C7BB60285A7B} = {F7876C9B-FB6A-4EFB-B058-D6967DB75FB2}
{6992D926-AB1C-4CD4-94D5-0319D14DB54B} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37}
Expand Down
4 changes: 2 additions & 2 deletions src/Compiler/AbstractIL/ilread.fs
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ let mkCacheInt32 lowMem _inbase _nm _sz =
if lowMem then
(fun f x -> f x)
else
let mutable cache = null
let mutable cache: ConcurrentDictionary<int32, _> MaybeNull = null // TODO NULLNESS: this explicit annotation should not be needed
let mutable count = 0
#if STATISTICS
addReport (fun oc ->
Expand Down Expand Up @@ -960,7 +960,7 @@ let mkCacheGeneric lowMem _inbase _nm _sz =
if lowMem then
(fun f x -> f x)
else
let mutable cache = null
let mutable cache: ConcurrentDictionary<_, _> MaybeNull = null // TODO NULLNESS: this explicit annotation should not be needed
let mutable count = 0
#if STATISTICS
addReport (fun oc ->
Expand Down
1 change: 0 additions & 1 deletion src/Compiler/Checking/CheckDeclarations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3211,7 +3211,6 @@ module EstablishTypeDefinitionCores =
tycon.TypeContents.tcaug_super |> Option.iter (fun ty -> if not (TypeNullIsExtraValue g m ty) then errorR (Error(FSComp.SR.tcAllowNullTypesMayOnlyInheritFromAllowNullTypes(), m)))
tycon.ImmediateInterfaceTypesOfFSharpTycon |> List.iter (fun ty -> if not (TypeNullIsExtraValue g m ty) then errorR (Error(FSComp.SR.tcAllowNullTypesMayOnlyInheritFromAllowNullTypes(), m)))


let structLayoutAttributeCheck allowed =
let explicitKind = int32 System.Runtime.InteropServices.LayoutKind.Explicit
match structLayoutAttr with
Expand Down
68 changes: 60 additions & 8 deletions src/Compiler/Checking/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,43 @@ let TranslatePartialValReprInfo tps (PrelimValReprInfo (argsData, retData)) =
// Members
//-------------------------------------------------------------------------

let TcAddNullnessToType (warn: bool) (cenv: cenv) (env: TcEnv) nullness innerTyC m =
let g = cenv.g
if g.langFeatureNullness then
if TypeNullNever g innerTyC then
let tyString = NicePrint.minimalStringOfType env.DisplayEnv innerTyC
errorR(Error(FSComp.SR.tcTypeDoesNotHaveAnyNull(tyString), m))

match tryAddNullnessToTy nullness innerTyC with

| None ->
let tyString = NicePrint.minimalStringOfType env.DisplayEnv innerTyC
errorR(Error(FSComp.SR.tcTypeDoesNotHaveAnyNull(tyString), m))
innerTyC

| Some innerTyCWithNull ->
// The inner type is not allowed to support null or use null as a representation value.
// For example "int option?" is not allowed, nor "string??".
//
// For variable types in FSharp.Core we make an exception because we must allow
// val toObj: value: 'T option -> 'T __withnull when 'T : not struct (* and 'T : __notnull *)
// wihout implying 'T is not null. This is because it is legitimate to use this
// function to "collapse" null and obj-null-coming-from-option using such a function.

if not g.compilingFSharpCore || not (isTyparTy g innerTyC) then
AddCxTypeDefnNotSupportsNull env.DisplayEnv cenv.css m NoTrace innerTyC

innerTyCWithNull

else
if warn then
warning(Error(FSComp.SR.tcNullnessCheckingNotEnabled(), m))
innerTyC

//-------------------------------------------------------------------------
// Members
//-------------------------------------------------------------------------

let ComputeLogicalName (id: Ident) (memberFlags: SynMemberFlags) =
match memberFlags.MemberKind with
| SynMemberKind.ClassConstructor -> ".cctor"
Expand Down Expand Up @@ -2085,7 +2122,7 @@ module GeneralizationHelpers =
match tp.Constraints |> List.partition (function TyparConstraint.CoercesTo _ -> true | _ -> false) with
| [TyparConstraint.CoercesTo(tgtTy, _)], others ->
// Throw away null constraints if they are implied
if others |> List.exists (function TyparConstraint.SupportsNull _ -> not (TypeSatisfiesNullConstraint g m tgtTy) | _ -> true)
if others |> List.exists (function TyparConstraint.SupportsNull _ -> not (TypeNullIsExtraValue g m tgtTy) | _ -> true)
then None
else Some tgtTy
| _ -> None
Expand Down Expand Up @@ -3965,6 +4002,13 @@ let rec TcTyparConstraint ridx (cenv: cenv) newOk checkConstraints occ (env: TcE
| SynTypeConstraint.WhereTyparSupportsNull(tp, m) ->
TcSimpleTyparConstraint cenv env newOk tpenv tp m AddCxTypeUseSupportsNull

| SynTypeConstraint.WhereTyparNotSupportsNull(tp, m) ->
if g.langFeatureNullness then
TcSimpleTyparConstraint cenv env newOk tpenv tp m AddCxTypeDefnNotSupportsNull
else
warning(Error(FSComp.SR.tcNullnessCheckingNotEnabled(), m))
tpenv

| SynTypeConstraint.WhereTyparIsComparable(tp, m) ->
TcSimpleTyparConstraint cenv env newOk tpenv tp m AddCxTypeMustSupportComparison

Expand Down Expand Up @@ -4377,11 +4421,18 @@ and TcTypeOrMeasure kindOpt (cenv: cenv) newOk checkConstraints occ (iwsam: Warn
| SynType.StaticConstant (synConst, m) ->
TcTypeStaticConstant kindOpt tpenv synConst m

| SynType.StaticConstantNull m
| SynType.StaticConstantNamed (_, _, m)
| SynType.StaticConstantExpr (_, m) ->
errorR(Error(FSComp.SR.parsInvalidLiteralInType(), m))
NewErrorType (), tpenv

| SynType.WithNull(innerTy, ambivalent, m) ->
let innerTyC, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv innerTy
let nullness = if ambivalent then KnownAmbivalentToNull else KnownWithNull
let tyWithNull = TcAddNullnessToType false cenv env nullness innerTyC m
tyWithNull, tpenv

| SynType.MeasurePower(ty, exponent, m) ->
TcTypeMeasurePower kindOpt cenv newOk checkConstraints occ env tpenv ty exponent m

Expand Down Expand Up @@ -4531,7 +4582,7 @@ and TcFunctionType (cenv: cenv) newOk checkConstraints occ env tpenv domainTy re
and TcArrayType (cenv: cenv) newOk checkConstraints occ env tpenv rank elemTy m =
let g = cenv.g
let elemTy, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv elemTy
let tyR = mkArrayTy g rank elemTy m
let tyR = mkArrayTy g rank g.knownWithoutNull elemTy m
tyR, tpenv

and TcTypeParameter kindOpt (cenv: cenv) env newOk tpenv tp =
Expand All @@ -4556,8 +4607,9 @@ and TcTypeWithConstraints (cenv: cenv) env newOk checkConstraints occ tpenv synT
and TcTypeHashConstraint (cenv: cenv) env newOk checkConstraints occ tpenv synTy m =
let tp = TcAnonTypeOrMeasure (Some TyparKind.Type) cenv TyparRigidity.WarnIfNotRigid TyparDynamicReq.Yes newOk m
let ty, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.No env tpenv synTy
AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css m NoTrace ty (mkTyparTy tp)
tp.AsType, tpenv
let tpTy = mkTyparTy tp
AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css m NoTrace ty tpTy
tpTy, tpenv

and TcTypeStaticConstant kindOpt tpenv c m =
match c, kindOpt with
Expand Down Expand Up @@ -4711,7 +4763,7 @@ and TcStaticConstantParameter (cenv: cenv) (env: TcEnv) tpenv kind (StripParenTy
| SynConst.Double n when typeEquiv g g.float_ty kind -> record(g.float_ty); box (n: double)
| SynConst.Char n when typeEquiv g g.char_ty kind -> record(g.char_ty); box (n: char)
| SynConst.String (s, _, _)
| SynConst.SourceIdentifier (_, s, _) when s <> null && typeEquiv g g.string_ty kind -> record(g.string_ty); box (s: string)
| SynConst.SourceIdentifier (_, s, _) when typeEquiv g g.string_ty kind -> record(g.string_ty); box (s: string)
| SynConst.Bool b when typeEquiv g g.bool_ty kind -> record(g.bool_ty); box (b: bool)
| _ -> fail()
v, tpenv
Expand Down Expand Up @@ -4740,7 +4792,6 @@ and TcStaticConstantParameter (cenv: cenv) (env: TcEnv) tpenv kind (StripParenTy
| Const.Single n -> record(g.float32_ty); box (n: single)
| Const.Double n -> record(g.float_ty); box (n: double)
| Const.Char n -> record(g.char_ty); box (n: char)
| Const.String null -> fail()
| Const.String s -> record(g.string_ty); box (s: string)
| Const.Bool b -> record(g.bool_ty); box (b: bool)
| _ -> fail()
Expand Down Expand Up @@ -4909,7 +4960,7 @@ and TcTypeApp (cenv: cenv) newOk checkConstraints occ env tpenv m tcref pathType
List.iter2 (UnifyTypes cenv env m) tinst actualArgTys

// Try to decode System.Tuple --> F# tuple types etc.
let ty = g.decompileType tcref actualArgTys
let ty = g.decompileType tcref actualArgTys g.knownWithoutNull

ty, tpenv

Expand Down Expand Up @@ -5565,7 +5616,8 @@ and TcExprUndelayed (cenv: cenv) (overallTy: OverallTy) env tpenv (synExpr: SynE
| SynExpr.Null m ->
TcNonControlFlowExpr env <| fun env ->
AddCxTypeUseSupportsNull env.DisplayEnv cenv.css m NoTrace overallTy.Commit
mkNull m overallTy.Commit, tpenv
let tyWithNull = addNullnessToTy KnownWithNull overallTy.Commit
mkNull m tyWithNull, tpenv

| SynExpr.Lazy (synInnerExpr, m) ->
TcNonControlFlowExpr env <| fun env ->
Expand Down
Loading