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 #15181

Merged
merged 208 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 205 commits
Commits
Show all changes
208 commits
Select commit Hold shift + click to select a range
2e8ab38
squash
dsyme May 24, 2023
5fc50c9
squash
dsyme May 24, 2023
208c48d
move adhoc tests and clean errors
dsyme May 24, 2023
e1ef334
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
dsyme May 24, 2023
74042c7
fix up constraint solving and adhoc testing
dsyme May 24, 2023
d4779f6
remove tests
dsyme May 24, 2023
c8cedb0
fantomas
dsyme May 24, 2023
4d2d637
skip fails
dsyme May 25, 2023
6bd707c
fix tests
dsyme May 25, 2023
c109cb4
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
dsyme May 25, 2023
2d7abe8
fix up test baselines for change in order in checking
dsyme May 25, 2023
2cbdcd0
update tests
dsyme May 25, 2023
382354a
don't overwrite baselines
dsyme May 25, 2023
1685da8
fix some test failures
dsyme May 25, 2023
11e88c8
skip warnings
dsyme May 25, 2023
211e7da
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
dsyme May 25, 2023
ee80415
skip warnings
dsyme May 25, 2023
f0fc3bf
fix warning logic
dsyme May 25, 2023
e4999fd
fix tests
dsyme May 25, 2023
0f83cd2
fix sizes
dsyme May 25, 2023
d3a7bc7
fix build
dsyme May 26, 2023
7b1afe0
fantomas and validation update
dsyme May 26, 2023
ffbbfd2
corrections to self-use
dsyme May 26, 2023
559c058
[WIP] [RFC FS-1060] Nullness checking (applied to codebase) (#15265)
dsyme Jun 2, 2023
a2edfd2
Revert "[WIP] [RFC FS-1060] Nullness checking (applied to codebase) (…
dsyme Jun 5, 2023
8b4f294
Merge main
vzarytovskii Jul 11, 2023
0c19792
Merge remote-tracking branch 'upstream/main' into feature/nullness
vzarytovskii Aug 3, 2023
cd063f3
Merge branch 'main' into feature/nullness
vzarytovskii Sep 7, 2023
4bfcda9
Merge with main
vzarytovskii Sep 7, 2023
9a58eb4
Fixes
vzarytovskii Sep 7, 2023
0e22136
Merge branch 'main' into feature/nullness
vzarytovskii Sep 7, 2023
f08b678
Feature/nullness - parsing of constraints (#15753)
T-Gro Sep 8, 2023
0d45bb9
applying changed syntax
T-Gro Sep 8, 2023
3811c98
positive.fs updated
T-Gro Sep 11, 2023
9edcc7f
positive.fs paranthesis
T-Gro Sep 11, 2023
60b1168
fixing "parse warning Remove spaces between the type name and type pa…
T-Gro Sep 11, 2023
ce815cd
positive .bsl updated
T-Gro Sep 11, 2023
4e275ce
Please mighty fantomas
T-Gro Sep 11, 2023
dea3e2f
Merge branch 'main' into feature/nullness
T-Gro Sep 12, 2023
0345c7b
Merge branch 'feature/nullness' into feature/nullness_apply_syntax
T-Gro Sep 12, 2023
9dbd29e
Merge pull request #15959 from dotnet/feature/nullness_apply_syntax
T-Gro Sep 14, 2023
aa844a4
Feature nullness metadata export (#15981)
T-Gro Oct 9, 2023
2a28419
Merge branch 'main' into feature/nullness
T-Gro Nov 28, 2023
c5b3781
fix merge mistake
T-Gro Nov 28, 2023
70adb59
fix build
T-Gro Nov 28, 2023
51ccb50
fantomas
T-Gro Nov 28, 2023
5a74640
bsl fix
T-Gro Nov 28, 2023
36761eb
Merge branch 'main' into feature/nullness
T-Gro Nov 28, 2023
f690ab6
il tests update
T-Gro Nov 28, 2023
ffd6567
fix test
T-Gro Nov 29, 2023
0ea09a6
tests fixed
T-Gro Nov 29, 2023
ce384d3
Merge branch 'main' into feature/nullness
T-Gro Nov 29, 2023
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
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
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
3250b7e
Fix ILType.Array import (#16585)
T-Gro Jan 25, 2024
cf735db
Merge branch 'main' into feature/nullness
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
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
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
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
bca1c53
Nullness :: Format string %s should allow nullable string (#16656)
T-Gro Feb 6, 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
d4dd6a8
Merge branch 'main' into feature/nullness
T-Gro Feb 8, 2024
552ea0a
Merge branch 'main' into feature/nullness
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
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
faba56d
Merge pull request #16980 from dotnet/merges/main-to-feature/nullness
KevinRansom Apr 4, 2024
a6be10c
Merge pull request #16989 from dotnet/merges/main-to-feature/nullness
T-Gro Apr 5, 2024
b8feeac
Merge pull request #16996 from dotnet/merges/main-to-feature/nullness
KevinRansom Apr 6, 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
bc8a27e
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Apr 12, 2024
58f8cac
Merge pull request #17037 from dotnet/merges/main-to-feature/nullness
T-Gro Apr 16, 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
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
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
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
7bde93c
Merge branch 'main' into feature/nullness
T-Gro Jun 17, 2024
679f605
Merge pull request #17320 from dotnet/merges/main-to-feature/nullness
T-Gro Jun 18, 2024
5488a35
Feature nullness :: Cleanups, Test reorg, fix incrementalbuild cache …
T-Gro Jun 19, 2024
107ee5c
Merge branch 'feature/nullness' into merges/main-to-feature/nullness
T-Gro Jun 26, 2024
dc92a0c
Merge pull request #17337 from dotnet/merges/main-to-feature/nullness
T-Gro Jun 26, 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
1f2e0c4
resolve semantic merge error
T-Gro Jul 3, 2024
ddd666d
merge
KevinRansom Jul 9, 2024
59938f4
Merge pull request #17395 from KevinRansom/nullness
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
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
972fa34
Update docs/release-notes/.FSharp.Compiler.Service/8.0.300.md
T-Gro Jul 11, 2024
c3d9efd
Merge branch 'main' into feature/nullness
vzarytovskii Jul 16, 2024
990c7ea
Update release notes
vzarytovskii Jul 16, 2024
1e74ec8
Update check.ps1
psfinaki Jul 16, 2024
1872156
Update check.ps1
psfinaki Jul 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .fantomasignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ nCrunchTemp_*
tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.actual
*.vsp
/tests/AheadOfTime/Trimming/output.txt
*.svclog
micro.exe
positive.exe
3 changes: 1 addition & 2 deletions FSharp.Benchmarks.sln
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32113.165
MinimumVisualStudioVersion = 10.0.40219.1
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' and '$(BUILDING_USING_DOTNET)' != 'true'">
<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
2 changes: 2 additions & 0 deletions docs/release-notes/.FSharp.Compiler.Service/8.0.300.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
* Fix StackOverflow when checking non-recursive bindings in module or namespace in `fscAnyCpu`/`fsiAnyCpu`. ([PR #16908](https://github.com/dotnet/fsharp/pull/16908))
* Removes signature file adjacency check in Transparent Compiler [Issue #17082](https://github.com/dotnet/fsharp/issues/17082) [PR #17085](https://github.com/dotnet/fsharp/pull/17085)


### Added

* Support for nullable reference types ([PR #15181](https://github.com/dotnet/fsharp/pull/15181))
* The stackguard depth for ILPdbWriter.unshadowScopes can be modified via the environment variable `FSHARP_ILPdb_UnshadowScopes_StackGuardDepth`([PR #16583](https://github.com/dotnet/fsharp/pull/16583))
* Parser recovers on complex primary constructor patterns, better tree representation for primary constructor patterns. ([PR #16425](https://github.com/dotnet/fsharp/pull/16425))
* Name resolution: keep type vars in subsequent checks ([PR #16456](https://github.com/dotnet/fsharp/pull/16456))
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Core/8.0.300.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
* Enforce AttributeTargets on structs and classes. Also update `RequireQualifiedAccessAttribute` and `AutoOpenAttribute` to use `AttributeTargets.Struct` ([PR #16790](https://github.com/dotnet/fsharp/pull/16790))
* Enforce AttributeTargets on enums. Also update `RequireQualifiedAccessAttribute` to use `AttributeTargets.Enum` ([PR #16887](https://github.com/dotnet/fsharp/pull/16887))
* Enforce AttributeTargets on delegates. Also update `ReflectedDefinitionAttribute` to use `AttributeTargets.Delegate` ([PR #16891](https://github.com/dotnet/fsharp/pull/16891))

1 change: 1 addition & 0 deletions docs/release-notes/.Language/preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* Speed up `for x in xs -> …` in list & array comprehensions in certain scenarios. ([PR #16948](https://github.com/dotnet/fsharp/pull/16948))
* Lower integral ranges to fast loops in more cases and optimize list and array construction from ranges. ([PR #16650](https://github.com/dotnet/fsharp/pull/16650), [PR #16832](https://github.com/dotnet/fsharp/pull/16832))
* Support for nullable reference types ([PR #15181](https://github.com/dotnet/fsharp/pull/15181))
* Better generic unmanaged structs handling. ([Language suggestion #692](https://github.com/fsharp/fslang-suggestions/issues/692), [PR #12154](https://github.com/dotnet/fsharp/pull/12154))
* Bidirectional F#/C# interop for 'unmanaged' constraint. ([PR #12154](https://github.com/dotnet/fsharp/pull/12154))
* Make `.Is*` discriminated union properties visible. ([Language suggestion #222](https://github.com/fsharp/fslang-suggestions/issues/222), [PR #16341](https://github.com/dotnet/fsharp/pull/16341))
Expand Down
32 changes: 25 additions & 7 deletions src/Compiler/AbstractIL/il.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2629,6 +2629,7 @@ type ILTypeDef
attributes: TypeAttributes,
layout: ILTypeDefLayout,
implements: ILTypes,
implementsCustomAttrs: (ILAttributesStored * int) list option,
genericParams: ILGenericParameterDefs,
extends: ILType option,
methods: ILMethodDefs,
Expand All @@ -2651,6 +2652,7 @@ type ILTypeDef
attributes,
layout,
implements,
implementsCustomAttrs,
genericParams,
extends,
methods,
Expand All @@ -2667,6 +2669,7 @@ type ILTypeDef
attributes,
layout,
implements,
implementsCustomAttrs,
genericParams,
extends,
methods,
Expand All @@ -2677,7 +2680,7 @@ type ILTypeDef
properties,
additionalFlags,
storeILSecurityDecls securityDecls,
customAttrs,
storeILCustomAttrs customAttrs,
NoMetadataIdx
)

Expand All @@ -2693,6 +2696,8 @@ type ILTypeDef

member _.Implements = implements

member _.ImplementsCustomAttrs = implementsCustomAttrs

member _.Extends = extends

member _.Methods = methods
Expand Down Expand Up @@ -2732,7 +2737,8 @@ type ILTypeDef
?properties,
?newAdditionalFlags,
?customAttrs,
?securityDecls
?securityDecls,
?implementsCustomAttrs
) =
ILTypeDef(
name = defaultArg name x.Name,
Expand All @@ -2741,6 +2747,7 @@ type ILTypeDef
genericParams = defaultArg genericParams x.GenericParams,
nestedTypes = defaultArg nestedTypes x.NestedTypes,
implements = defaultArg implements x.Implements,
implementsCustomAttrs = defaultArg implementsCustomAttrs x.ImplementsCustomAttrs,
extends = defaultArg extends x.Extends,
methods = defaultArg methods x.Methods,
securityDecls = defaultArg securityDecls x.SecurityDecls,
Expand All @@ -2749,7 +2756,7 @@ type ILTypeDef
events = defaultArg events x.Events,
properties = defaultArg properties x.Properties,
additionalFlags = defaultArg newAdditionalFlags additionalFlags,
customAttrs = defaultArg customAttrs (storeILCustomAttrs x.CustomAttrs)
customAttrs = defaultArg customAttrs (x.CustomAttrs)
)

member x.CustomAttrs: ILAttributes =
Expand Down Expand Up @@ -3439,6 +3446,11 @@ type ILGlobals(primaryScopeRef: ILScopeRef, equivPrimaryAssemblyRefs: ILAssembly

let mkSysILTypeRef nm = mkILTyRef (primaryScopeRef, nm)

let byteIlType = ILType.Value(mkILNonGenericTySpec (mkSysILTypeRef tname_Byte))

let stringIlType =
mkILBoxedType (mkILNonGenericTySpec (mkSysILTypeRef tname_String))

member _.primaryAssemblyScopeRef = primaryScopeRef

member x.primaryAssemblyRef =
Expand All @@ -3456,7 +3468,7 @@ type ILGlobals(primaryScopeRef: ILScopeRef, equivPrimaryAssemblyRefs: ILAssembly

member val typ_Object = mkILBoxedType (mkILNonGenericTySpec (mkSysILTypeRef tname_Object))

member val typ_String = mkILBoxedType (mkILNonGenericTySpec (mkSysILTypeRef tname_String))
member val typ_String = stringIlType

member val typ_Array = mkILBoxedType (mkILNonGenericTySpec (mkSysILTypeRef tname_Array))

Expand All @@ -3470,7 +3482,11 @@ type ILGlobals(primaryScopeRef: ILScopeRef, equivPrimaryAssemblyRefs: ILAssembly

member val typ_Int64 = ILType.Value(mkILNonGenericTySpec (mkSysILTypeRef tname_Int64))

member val typ_Byte = ILType.Value(mkILNonGenericTySpec (mkSysILTypeRef tname_Byte))
member val typ_Byte = byteIlType

member val typ_ByteArray = ILType.Array(ILArrayShape.SingleDimensional, byteIlType)

member val typ_StringArray = ILType.Array(ILArrayShape.SingleDimensional, stringIlType)

member val typ_UInt16 = ILType.Value(mkILNonGenericTySpec (mkSysILTypeRef tname_UInt16))

Expand Down Expand Up @@ -4231,12 +4247,13 @@ let mkILGenericClass (nm, access, genparams, extends, impl, methods, fields, nes
attributes = attributes,
genericParams = genparams,
implements = impl,
implementsCustomAttrs = None,
layout = ILTypeDefLayout.Auto,
extends = Some extends,
methods = methods,
fields = fields,
nestedTypes = nestedTypes,
customAttrs = storeILCustomAttrs attrs,
customAttrs = attrs,
methodImpls = emptyILMethodImpls,
properties = props,
events = events,
Expand All @@ -4255,12 +4272,13 @@ let mkRawDataValueTypeDef (iltyp_ValueType: ILType) (nm, size, pack) =
||| TypeAttributes.BeforeFieldInit
||| TypeAttributes.AnsiClass),
implements = [],
implementsCustomAttrs = None,
extends = Some iltyp_ValueType,
layout = ILTypeDefLayout.Explicit { Size = Some size; Pack = Some pack },
methods = emptyILMethods,
fields = emptyILFields,
nestedTypes = emptyILTypeDefs,
customAttrs = emptyILCustomAttrsStored,
customAttrs = emptyILCustomAttrs,
methodImpls = emptyILMethodImpls,
properties = emptyILProperties,
events = emptyILEvents,
Expand Down
32 changes: 28 additions & 4 deletions src/Compiler/AbstractIL/il.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,13 @@ type ILAttributes =

/// Represents the efficiency-oriented storage of ILAttributes in another item.
[<NoEquality; NoComparison>]
type ILAttributesStored
type ILAttributesStored =
/// Computed by ilread.fs based on metadata index
| Reader of (int32 -> ILAttribute[])
/// Already computed
| Given of ILAttributes

member GetCustomAttrs: int32 -> ILAttributes

/// Method parameters and return values.
[<RequireQualifiedAccess; NoEquality; NoComparison>]
Expand Down Expand Up @@ -1070,6 +1076,8 @@ type ILMethodDef =
member IsEntryPoint: bool
member GenericParams: ILGenericParameterDefs
member CustomAttrs: ILAttributes
member MetadataIndex: int32
member CustomAttrsStored: ILAttributesStored
member ParameterTypes: ILTypes
member IsIL: bool
member Code: ILCode option
Expand Down Expand Up @@ -1243,6 +1251,10 @@ type ILFieldDef =

member CustomAttrs: ILAttributes

member MetadataIndex: int32

member CustomAttrsStored: ILAttributesStored

member IsStatic: bool

member IsSpecialName: bool
Expand Down Expand Up @@ -1326,6 +1338,8 @@ type ILEventDef =
member FireMethod: ILMethodRef option
member OtherMethods: ILMethodRef list
member CustomAttrs: ILAttributes
member MetadataIndex: int32
member CustomAttrsStored: ILAttributesStored
member IsSpecialName: bool
member IsRTSpecialName: bool

Expand Down Expand Up @@ -1388,6 +1402,8 @@ type ILPropertyDef =
member Init: ILFieldInit option
member Args: ILTypes
member CustomAttrs: ILAttributes
member MetadataIndex: int32
member CustomAttrsStored: ILAttributesStored
member IsSpecialName: bool
member IsRTSpecialName: bool

Expand Down Expand Up @@ -1498,6 +1514,7 @@ type ILTypeDef =
attributes: TypeAttributes *
layout: ILTypeDefLayout *
implements: ILTypes *
implementsCustomAttrs: (ILAttributesStored * int) list option *
genericParams: ILGenericParameterDefs *
extends: ILType option *
methods: ILMethodDefs *
Expand All @@ -1518,6 +1535,7 @@ type ILTypeDef =
attributes: TypeAttributes *
layout: ILTypeDefLayout *
implements: ILTypes *
implementsCustomAttrs: (ILAttributesStored * int) list option *
genericParams: ILGenericParameterDefs *
extends: ILType option *
methods: ILMethodDefs *
Expand All @@ -1528,7 +1546,7 @@ type ILTypeDef =
properties: ILPropertyDefs *
additionalFlags: ILTypeDefAdditionalFlags *
securityDecls: ILSecurityDecls *
customAttrs: ILAttributesStored ->
customAttrs: ILAttributes ->
ILTypeDef

member Name: string
Expand All @@ -1537,6 +1555,7 @@ type ILTypeDef =
member Layout: ILTypeDefLayout
member NestedTypes: ILTypeDefs
member Implements: ILTypes
member ImplementsCustomAttrs: (ILAttributesStored * int) list option
member Extends: ILType option
member Methods: ILMethodDefs
member SecurityDecls: ILSecurityDecls
Expand All @@ -1545,6 +1564,8 @@ type ILTypeDef =
member Events: ILEventDefs
member Properties: ILPropertyDefs
member CustomAttrs: ILAttributes
member MetadataIndex: int32
member CustomAttrsStored: ILAttributesStored
member IsClass: bool
member IsStruct: bool
member IsInterface: bool
Expand Down Expand Up @@ -1593,8 +1614,9 @@ type ILTypeDef =
?events: ILEventDefs *
?properties: ILPropertyDefs *
?newAdditionalFlags: ILTypeDefAdditionalFlags *
?customAttrs: ILAttributesStored *
?securityDecls: ILSecurityDecls ->
?customAttrs: ILAttributes *
?securityDecls: ILSecurityDecls *
?implementsCustomAttrs: (ILAttributesStored * int) list option ->
ILTypeDef

/// Represents a prefix of information for ILTypeDef.
Expand Down Expand Up @@ -1890,11 +1912,13 @@ type internal ILGlobals =
member typ_Enum: ILType
member typ_Object: ILType
member typ_String: ILType
member typ_StringArray: ILType
member typ_Type: ILType
member typ_Array: ILType
member typ_IntPtr: ILType
member typ_UIntPtr: ILType
member typ_Byte: ILType
member typ_ByteArray: ILType
member typ_Int16: ILType
member typ_Int32: ILType
member typ_Int64: ILType
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/AbstractIL/ilmorph.fs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ let rec tdef_ty2ty_ilmbody2ilmbody_mdefs2mdefs isInKnownSet enc fs (tdef: ILType
methodImpls = mimpls_ty2ty fTyInCtxtR tdef.MethodImpls,
events = edefs_ty2ty fTyInCtxtR tdef.Events,
properties = pdefs_ty2ty fTyInCtxtR tdef.Properties,
customAttrs = storeILCustomAttrs (cattrs_ty2ty fTyInCtxtR tdef.CustomAttrs)
customAttrs = cattrs_ty2ty fTyInCtxtR tdef.CustomAttrs
)

and tdefs_ty2ty_ilmbody2ilmbody_mdefs2mdefs isInKnownSet enc fs tdefs =
Expand Down
Loading
Loading