Skip to content

Commit d21aa8a

Browse files
authored
cherrypick 18355 (#18367)
* cherrypick 18355 * revert attributes feature (#18355) * revert attributes * release notes
1 parent 76b83e6 commit d21aa8a

File tree

5 files changed

+76
-16
lines changed

5 files changed

+76
-16
lines changed

buildtools/checkpackages/FSharp.Core_notshipped.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Import Project="$(MSBuildProjectDirectory)\..\..\eng\Versions.props" />
44

55
<PropertyGroup>
6-
<TargetFramework>ne87.0</TargetFramework>
6+
<TargetFramework>net9.0</TargetFramework>
77
</PropertyGroup>
88

99
<PropertyGroup>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
### Fixed
2+
3+
* Fix missing TailCall warning in Sequential in use scope ([PR #17927](https://github.com/dotnet/fsharp/pull/17927))
4+
* Fix false negatives for passing null to "obj" arguments. Only "obj | null" can now subsume any type ([PR #17757](https://github.com/dotnet/fsharp/pull/17757))
5+
* Fix internal error when calling 'AddSingleton' and other overloads only differing in generic arity ([PR #17804](https://github.com/dotnet/fsharp/pull/17804))
6+
* Fix extension methods support for non-reference system assemblies ([PR #17799](https://github.com/dotnet/fsharp/pull/17799))
7+
* Ensure `frameworkTcImportsCache` mutations are threadsafe. ([PR #17795](https://github.com/dotnet/fsharp/pull/17795))
8+
* Disallow abstract member with access modifiers in sig file. ([PR #17802](https://github.com/dotnet/fsharp/pull/17802))
9+
* Fix concurrency issue in `ILPreTypeDefImpl` ([PR #17812](https://github.com/dotnet/fsharp/pull/17812))
10+
* Fix nullness inference for member val and other OO scenarios ([PR #17845](https://github.com/dotnet/fsharp/pull/17845))
11+
* Fix internal error when analyzing incomplete inherit member ([PR #17905](https://github.com/dotnet/fsharp/pull/17905))
12+
* Add warning when downcasting from nullable type to non-nullable ([PR #17965](https://github.com/dotnet/fsharp/pull/17965))
13+
* Fix missing nullness warning in case of method resolution multiple candidates ([PR #17917](https://github.com/dotnet/fsharp/pull/17918))
14+
* Fix failure to use bound values in `when` clauses of `try-with` in `seq` expressions ([PR #17990](https://github.com/dotnet/fsharp/pull/17990))
15+
* Fix locals allocating for the special `copyOfStruct` defensive copy ([PR #18025](https://github.com/dotnet/fsharp/pull/18025))
16+
* Fix lowering of computed array expressions when the expression consists of a simple mapping from a `uint64` or `unativeint` array. [PR #18081](https://github.com/dotnet/fsharp/pull/18081)
17+
* Add missing nullable-metadata for C# consumers of records,exceptions and DU subtypes generated from F# code. [PR #18079](https://github.com/dotnet/fsharp/pull/18079)
18+
* Reduce excess memory usage in TransparentCompiler. [PR #17543](https://github.com/dotnet/fsharp/pull/17543)
19+
* Fix a race condition in file book keeping in the compiler service ([#18008](https://github.com/dotnet/fsharp/pull/18008))
20+
* Fix trimming '%' characters when lowering interpolated string to a concat call [PR #18123](https://github.com/dotnet/fsharp/pull/18123)
21+
* Completion: fix qualified completion in sequence expressions [PR #18111](https://github.com/dotnet/fsharp/pull/18111)
22+
* Symbols: try to use ValReprInfoForDisplay in Mfv.CurriedParameterGroups ([PR #18124](https://github.com/dotnet/fsharp/pull/18124))
23+
* Shim/file system: fix leaks of the shim [PR #18144](https://github.com/dotnet/fsharp/pull/18144)
24+
25+
### Added
26+
27+
* Let `dotnet fsi --help` print a link to the documentation website. ([PR #18006](https://github.com/dotnet/fsharp/pull/18006))
28+
* Deprecate places where `seq` can be omitted. ([Language suggestion #1033](https://github.com/fsharp/fslang-suggestions/issues/1033), [PR #17772](https://github.com/dotnet/fsharp/pull/17772))
29+
* Support literal attribute on decimals ([PR #17769](https://github.com/dotnet/fsharp/pull/17769))
30+
* Added type conversions cache, only enabled for compiler runs, guarded by language version preview ([PR #17668](https://github.com/dotnet/fsharp/pull/17668))
31+
* Added project property ParallelCompilation which turns on graph based type checking, parallel ILXGen and parallel optimization. By default on for users of langversion=preview ([PR #17948](https://github.com/dotnet/fsharp/pull/17948))
32+
* Adding warning when consuming generic method returning T|null for types not supporting nullness (structs,anons,tuples) ([PR #18057](https://github.com/dotnet/fsharp/pull/18057))
33+
* Sink: report SynPat.ArrayOrList type ([PR #18127](https://github.com/dotnet/fsharp/pull/18127))
34+
* Show the default value of compiler options ([PR #18054](https://github.com/dotnet/fsharp/pull/18054))
35+
* Support ValueOption + Struct attribute as optional parameter for methods ([Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098))
36+
* Cancellable: add safer APIs to check the token ([PR #18175](https://github.com/dotnet/fsharp/pull/18175))
37+
38+
### Changed
39+
40+
* Make ILTypeDef interface impls calculation lazy. ([PR #17392](https://github.com/dotnet/fsharp/pull/17392))
41+
* Remove non-functional useSyntaxTreeCache option. ([PR #17768](https://github.com/dotnet/fsharp/pull/17768))
42+
* Better ranges for CE `let!` and `use!` error reporting. ([PR #17712](https://github.com/dotnet/fsharp/pull/17712))
43+
* Better ranges for CE `do!` error reporting. ([PR #17779](https://github.com/dotnet/fsharp/pull/17779))
44+
* Better ranges for CE `return, yield, return! and yield!` error reporting. ([PR #17792](https://github.com/dotnet/fsharp/pull/17792))
45+
* Better ranges for CE `match!`. ([PR #17789](https://github.com/dotnet/fsharp/pull/17789))
46+
* Better ranges for CE `use` error reporting. ([PR #17811](https://github.com/dotnet/fsharp/pull/17811))
47+
* Better ranges for `inherit` error reporting. ([PR #17879](https://github.com/dotnet/fsharp/pull/17879))
48+
* Better ranges for `inherit` `struct` error reporting. ([PR #17886](https://github.com/dotnet/fsharp/pull/17886))
49+
* Warn on uppercase identifiers in patterns. ([PR #15816](https://github.com/dotnet/fsharp/pull/15816))
50+
* Better ranges for `inherit` objects error reporting. ([PR #17893](https://github.com/dotnet/fsharp/pull/17893))
51+
* Better ranges for #nowarn error reporting; bring back #nowarn warnings for --langVersion:80; add warnings under feature flag ([PR #17871](https://github.com/dotnet/fsharp/pull/17871))
52+
* Better ranges for #nowarn error reporting; bring back #nowarn warnings for --langVersion:80; add warnings under feature flag ([PR #17871](https://github.com/dotnet/fsharp/pull/17871))
53+
* CheckAndThrow can be invoked only from within Cancellable context ([PR #18037](https://github.com/dotnet/fsharp/pull/18037))
54+
* Make ILTypeDef base type calculation lazy. ([PR #18005](https://github.com/dotnet/fsharp/pull/18005))
55+
* Revert EnforceAttributeTargets Feature. ([PR #18005](https://github.com/dotnet/fsharp/pull/18005))
56+
57+
### Breaking Changes
58+
59+
* Aliasing `StructAttribute` will now produce a warning (part of [Language suggestion #18298](https://github.com/fsharp/fslang-suggestions/issues/18298), [PR #18355](https://github.com/dotnet/fsharp/pull/18355))

docs/release-notes/.Language/9.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* Enforce AttributeTargets on implicit constructors. ([PR #16845](https://github.com/dotnet/fsharp/pull/16845/))
2222
* Enforce AttributeTargets on structs and classes ([PR #16790](https://github.com/dotnet/fsharp/pull/16790))
2323
* Ensure consistent interaction between ``#line` and `#nowarn` directives ([PR #17649](https://github.com/dotnet/fsharp/pull/17649))
24+
* Revert EnforceAttributeTargets Feature. ([PR #18005](https://github.com/dotnet/fsharp/pull/18005))
2425

2526

2627
### Changed

src/Compiler/Facilities/LanguageFeatures.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ type LanguageVersion(versionText) =
217217
LanguageFeature.LowerSimpleMappingsInComprehensionsToFastLoops, languageVersion90
218218
LanguageFeature.ParsedHashDirectiveArgumentNonQuotes, languageVersion90
219219
LanguageFeature.EmptyBodiedComputationExpressions, languageVersion90
220-
LanguageFeature.EnforceAttributeTargets, languageVersion90
221220

222221
// F# preview
222+
LanguageFeature.EnforceAttributeTargets, previewVersion // Not enabled due to a number of external library dependencies on unenforced attributes
223223
LanguageFeature.UseTypeSubsumptionCache, previewVersion
224224
LanguageFeature.UnmanagedConstraintCsharpInterop, previewVersion // not enabled because: https://github.com/dotnet/fsharp/issues/17509
225225
LanguageFeature.FromEndSlicing, previewVersion // Unfinished features --- needs work

tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ module CustomAttributes_AttributeUsage =
100100
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"E_AttributeTargets01.fs"|])>]
101101
let ``E_AttributeTargets01_fs`` compilation =
102102
compilation
103-
|> withLangVersion90
103+
|> withLangVersionPreview
104104
|> verifyCompile
105105
|> shouldFail
106106
|> withDiagnostics [
@@ -136,7 +136,7 @@ module CustomAttributes_AttributeUsage =
136136
let ``E_AttributeTargetIsField01_fs`` compilation =
137137
compilation
138138
|> withOptions ["--nowarn:25"]
139-
|> withLangVersion90
139+
|> withLangVersionPreview
140140
|> verifyCompile
141141
|> shouldFail
142142
|> withDiagnostics [
@@ -189,7 +189,7 @@ module CustomAttributes_AttributeUsage =
189189
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"E_AttributeTargetIsMethod02.fs"|])>]
190190
let ``E_AttributeTargetIsMethod02_fs`` compilation =
191191
compilation
192-
|> withLangVersion90
192+
|> withLangVersionPreview
193193
|> withOptions ["--nowarn:25"]
194194
|> verifyCompile
195195
|> shouldFail
@@ -220,7 +220,7 @@ module CustomAttributes_AttributeUsage =
220220
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"E_AttributeTargetIsMethod03.fs"|])>]
221221
let ``E_AttributeTargetIsMethod03_fs`` compilation =
222222
compilation
223-
|> withLangVersion90
223+
|> withLangVersionPreview
224224
|> withOptions ["--nowarn:25"]
225225
|> verifyCompile
226226
|> shouldFail
@@ -338,7 +338,7 @@ module CustomAttributes_AttributeUsage =
338338
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"E_AttributeTargetIsStruct.fs"|])>]
339339
let ``E_AttributeTargetIsStruct_fs`` compilation =
340340
compilation
341-
|> withLangVersion90
341+
|> withLangVersionPreview
342342
|> verifyCompile
343343
|> shouldFail
344344
|> withDiagnostics [
@@ -368,7 +368,7 @@ module CustomAttributes_AttributeUsage =
368368
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"E_AttributeTargetIsClass.fs"|])>]
369369
let ``E_AttributeTargetIsClass_fs`` compilation =
370370
compilation
371-
|> withLangVersion90
371+
|> withLangVersionPreview
372372
|> verifyCompile
373373
|> shouldFail
374374
|> withDiagnostics [
@@ -389,7 +389,7 @@ module CustomAttributes_AttributeUsage =
389389
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"E_AttributeTargetIsClass01.fs"|])>]
390390
let ``E_AttributeTargetIsClass01_fs`` compilation =
391391
compilation
392-
|> withLangVersion90
392+
|> withLangVersionPreview
393393
|> verifyCompile
394394
|> shouldFail
395395
|> withDiagnostics [
@@ -487,7 +487,7 @@ module CustomAttributes_AttributeUsage =
487487
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"E_AttributeTargetIsField03.fs"|])>]
488488
let ``E_AttributeTargetIsField03_fs`` compilation =
489489
compilation
490-
|> withLangVersion90
490+
|> withLangVersionPreview
491491
|> verifyCompile
492492
|> shouldFail
493493
|> withDiagnostics [
@@ -507,7 +507,7 @@ module CustomAttributes_AttributeUsage =
507507
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"E_AttributeTargetIsProperty01.fs"|])>]
508508
let ``E_AttributeTargetIsProperty01_fs`` compilation =
509509
compilation
510-
|> withLangVersion90
510+
|> withLangVersionPreview
511511
|> verifyCompile
512512
|> shouldFail
513513
|> withDiagnostics [
@@ -527,7 +527,7 @@ module CustomAttributes_AttributeUsage =
527527
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"E_AttributeTargetIsCtor01.fs"|])>]
528528
let ``E_AttributeTargetIsCtor01_fs`` compilation =
529529
compilation
530-
|> withLangVersion90
530+
|> withLangVersionPreview
531531
|> verifyCompile
532532
|> shouldFail
533533
|> withDiagnostics [
@@ -564,7 +564,7 @@ module CustomAttributes_AttributeUsage =
564564
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"E_AttributeTargetIsEnum01.fs"|])>]
565565
let ``E_AttributeTargetIsEnum01_fs`` compilation =
566566
compilation
567-
|> withLangVersion90
567+
|> withLangVersionPreview
568568
|> verifyCompile
569569
|> shouldFail
570570
|> withDiagnostics [
@@ -601,7 +601,7 @@ module CustomAttributes_AttributeUsage =
601601
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"E_AttributeTargetIsDelegate01.fs"|])>]
602602
let ``E_AttributeTargetsIsDelegate01_fs`` compilation =
603603
compilation
604-
|> withLangVersion90
604+
|> withLangVersionPreview
605605
|> verifyCompile
606606
|> shouldFail
607607
|> withDiagnostics [
@@ -650,7 +650,7 @@ type InterruptibleLazy<'T> private (valueFactory: unit -> 'T) =
650650
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"E_AttributeTargetIsInterface.fs"|])>]
651651
let ``E_AttributeTargetIsInterface_fs`` compilation =
652652
compilation
653-
|> withLangVersion90
653+
|> withLangVersionPreview
654654
|> verifyCompile
655655
|> shouldFail
656656
|> withDiagnostics [
@@ -672,7 +672,7 @@ type InterruptibleLazy<'T> private (valueFactory: unit -> 'T) =
672672
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"E_AttributeTargetIsClass02.fs"|])>]
673673
let ``E_AttributeTargetIsClass02_fs`` compilation =
674674
compilation
675-
|> withLangVersion90
675+
|> withLangVersionPreview
676676
|> verifyCompile
677677
|> shouldFail
678678
|> withDiagnostics [

0 commit comments

Comments
 (0)