Skip to content

Commit 9da94fe

Browse files
Renumber and-deprecation warning FS3885 → FS3887 after rebase
Upstream main took FS3885 (parsLetBangCannotBeLastInCE) and FS3886 (tcListLiteralWithSingleTupleElement) for unrelated warnings during the rebase window. Our chkAndKeywordDeprecatedWithFileOrderAuto is now numbered FS3887. Updates: - docs (migration, release-notes, design): all FS3885 / 3885 → FS3887. - docs/release-notes/.FSharp.Compiler.Service/11.0.100.md: move our entry from "Breaking Changes" (where the rebase merge-3-way landed it) back to "Added" — opt-in flag with default off is not a breaking change. Update FS3885 → FS3887 in the entry text. - tests/file-order-auto-test/deprecation-test/run-all.sh: assertions and grep patterns updated to FS3887. - tests/file-order-auto-test/fcs-ide-smoke-test/Program.fs: ErrorNumber filter and labels updated to 3887. - tests/file-order-auto-test/oss-sweep/RESULTS.md: reproduction instructions reference --nowarn:3887. Build clean, deprecation fixture 3/3, inference 4/4, fsi 2/2, error-corpus 6/6.
1 parent aa9a6f8 commit 9da94fe

7 files changed

Lines changed: 25 additions & 25 deletions

File tree

docs/file-order-auto-design.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ which we haven't implemented).
268268
| FCS | `src/Compiler/Service/IncrementalBuild.fs` | `computeReorderedFileNames` runs the same logic for `IncrementalBuilder` |
269269
| MSBuild | `src/FSharp.Build/Microsoft.FSharp.NetSdk.props` + `Targets` + `Fsc.fs` | `FSharpAutoFileOrder=true``--file-order-auto+` |
270270
| Compiler options | `src/Compiler/Driver/CompilerOptions.fs` | flag parsing, default-on/off, help text |
271-
| Localized strings | `src/Compiler/FSComp.txt` + 13× `xlf` | `optsFileOrderAuto`, FS3885 message |
271+
| Localized strings | `src/Compiler/FSComp.txt` + 13× `xlf` | `optsFileOrderAuto`, FS3887 message |
272272

273273
## The chain of refinements (TL;DR)
274274

docs/file-order-auto-migration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ make types mutually recursive, see [Migrating off `and`](#migrating-off-and).
7272
## Migrating off `and`
7373

7474
When `--file-order-auto+` is set, every `and`-joined type declaration emits
75-
warning **FS3885**:
75+
warning **FS3887**:
7676

7777
> The 'and' keyword for mutually recursive types is unnecessary when using
7878
> `--file-order-auto`. Consider placing types in separate declarations. This
@@ -89,13 +89,13 @@ cycle group automatically.
8989
The warning is suppressable like any other:
9090

9191
```xml
92-
<NoWarn>3885</NoWarn>
92+
<NoWarn>3887</NoWarn>
9393
```
9494

9595
or
9696

9797
```bash
98-
fsc --file-order-auto+ --nowarn:3885 ...
98+
fsc --file-order-auto+ --nowarn:3887 ...
9999
```
100100

101101
## How it works (briefly)

docs/file-order-auto-release-notes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ to maintain `.fsproj` file ordering by hand.
1616
and Find-All-References work end-to-end on auto-ordered projects.
1717
- **Cycle group synthesis** (build path only): a set of files that mutually
1818
reference each other gets compiled as one synthetic recursive namespace.
19-
- **`and`-keyword deprecation** (warning **FS3885**): under `--file-order-auto+`,
19+
- **`and`-keyword deprecation** (warning **FS3887**): under `--file-order-auto+`,
2020
`type X = ... and Y = ...` now produces a deprecation warning. Suppressable
21-
via `--nowarn:3885` or `<NoWarn>3885</NoWarn>`. The warning is silent in
21+
via `--nowarn:3887` or `<NoWarn>3887</NoWarn>`. The warning is silent in
2222
manual mode.
2323

2424
## What hasn't changed
@@ -76,9 +76,9 @@ the regression sweep at `tests/file-order-auto-test/`.
7676
| `inference-tests/` | SRTP, record/union disambiguation, operator overloads (4/4). |
7777
| `fsi-tests/` | `.fsi`/`.fs` pairing with partial coverage and ordering constraints (2/2). |
7878
| `error-corpus/` | Six error categories, byte-for-byte parity manual vs auto (6/6). |
79-
| `deprecation-test/` | FS3885 fires/suppresses correctly (3/3). |
79+
| `deprecation-test/` | FS3887 fires/suppresses correctly (3/3). |
8080
| `fcs-smoke-test/` | `FSharpChecker.ParseAndCheckProject` reorders via OtherOptions. |
81-
| `fcs-ide-smoke-test/` | Completions, Go-to-Def, Find-References, FS3885 via FCS. |
81+
| `fcs-ide-smoke-test/` | Completions, Go-to-Def, Find-References, FS3887 via FCS. |
8282
| `oss-sweep/` | 13 real-world OSS projects under `--file-order-auto+`. **Auto-mode adds zero errors over baseline for every buildable target.** See [`tests/file-order-auto-test/oss-sweep/RESULTS.md`](../tests/file-order-auto-test/oss-sweep/RESULTS.md). |
8383

8484
### OSS sweep results

docs/release-notes/.FSharp.Compiler.Service/11.0.100.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040

4141
* Added warning FS3884 when a function or delegate value is used as an interpolated string argument. ([PR #19289](https://github.com/dotnet/fsharp/pull/19289))
4242
* Add `#version;;` directive to F# Interactive to display version and environment information. ([Issue #13307](https://github.com/dotnet/fsharp/issues/13307), [PR #19332](https://github.com/dotnet/fsharp/pull/19332))
43+
* Add opt-in `--file-order-auto+` flag (and `<FSharpAutoFileOrder>` MSBuild property) for dependency-based source-file ordering. Off by default; when enabled, the compiler reorders project sources by their declaration/reference graph before type checking, supports cycle groups via synthesised recursive namespaces (build path), and emits warning FS3887 for `and`-joined type chains. FCS support included. ([PR #19647](https://github.com/dotnet/fsharp/pull/19647))
4344

4445
### Changed
4546

4647
* Improvements in error and warning messages: new error FS3885 when `let!`/`use!` is the final expression in a computation expression; new warning FS3886 when a list literal contains a single tuple element (likely missing `;` separator); improved wording for FS0003, FS0025, FS0039, FS0072, FS0247, FS0597, FS0670, FS3082, and SRTP operator-not-in-scope hints. ([PR #19398](https://github.com/dotnet/fsharp/pull/19398))
4748

4849
### Breaking Changes
49-
* Add opt-in `--file-order-auto+` flag (and `<FSharpAutoFileOrder>` MSBuild property) for dependency-based source-file ordering. Off by default; when enabled, the compiler reorders project sources by their declaration/reference graph before type checking, supports cycle groups via synthesised recursive namespaces (build path), and emits warning FS3885 for `and`-joined type chains. FCS support included. ([PR #19647](https://github.com/dotnet/fsharp/pull/19647))

tests/file-order-auto-test/deprecation-test/run-all.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
2-
# Validates the FS3885 ('and' keyword) deprecation warning behaves correctly:
2+
# Validates the FS3887 ('and' keyword) deprecation warning behaves correctly:
33
# - manual mode: silent (warning gated on cenv.fileOrderAuto)
44
# - auto mode: warning fires once per `and`-joined declaration tail
5-
# - auto mode + --nowarn:3885: silent
5+
# - auto mode + --nowarn:3887: silent
66

77
set -u
88

@@ -21,16 +21,16 @@ fail=0
2121
tmpout=$(mktemp)
2222
trap 'rm -f "$tmpout" out_dep_*.dll' EXIT
2323

24-
count_3885 () {
25-
grep -c "FS3885" "$1" || true
24+
count_3887 () {
25+
grep -c "FS3887" "$1" || true
2626
}
2727

2828
assert () {
2929
local label="$1"
3030
local expected="$2"
3131
local got="$3"
3232
if [ "$expected" = "$got" ]; then
33-
echo " PASS: $label (FS3885 count=$got)"
33+
echo " PASS: $label (FS3887 count=$got)"
3434
pass=$((pass + 1))
3535
else
3636
echo " FAIL: $label (expected $expected, got $got)"
@@ -40,17 +40,17 @@ assert () {
4040

4141
echo "--- manual mode (no flag) ---"
4242
$FSC $COMMON_FLAGS -o:out_dep_manual.dll "$SRC" 2>&1 | tee "$tmpout" >/dev/null
43-
assert "manual mode emits no FS3885" 0 "$(count_3885 "$tmpout")"
43+
assert "manual mode emits no FS3887" 0 "$(count_3887 "$tmpout")"
4444

4545
echo "--- auto mode (--file-order-auto+) ---"
4646
$FSC $COMMON_FLAGS --file-order-auto+ -o:out_dep_auto.dll "$SRC" 2>&1 | tee "$tmpout" >/dev/null
4747
# AndUsage.fs has two `and`-joined groups, each contributes one warning
4848
# (only the tail entries trigger; first head doesn't).
49-
assert "auto mode emits FS3885 for each and-tail (expect 2)" 2 "$(count_3885 "$tmpout")"
49+
assert "auto mode emits FS3887 for each and-tail (expect 2)" 2 "$(count_3887 "$tmpout")"
5050

51-
echo "--- auto mode + --nowarn:3885 ---"
52-
$FSC $COMMON_FLAGS --file-order-auto+ --nowarn:3885 -o:out_dep_suppress.dll "$SRC" 2>&1 | tee "$tmpout" >/dev/null
53-
assert "--nowarn:3885 suppresses FS3885" 0 "$(count_3885 "$tmpout")"
51+
echo "--- auto mode + --nowarn:3887 ---"
52+
$FSC $COMMON_FLAGS --file-order-auto+ --nowarn:3887 -o:out_dep_suppress.dll "$SRC" 2>&1 | tee "$tmpout" >/dev/null
53+
assert "--nowarn:3887 suppresses FS3887" 0 "$(count_3887 "$tmpout")"
5454

5555
echo ""
5656
echo "=== Results: $pass passed, $fail failed ==="

tests/file-order-auto-test/fcs-ide-smoke-test/Program.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module FcsIdeSmokeTest.Program
22

33
// Exercises IDE-style FCS APIs against an auto-ordered project to confirm
4-
// IntelliSense, Go-to-Definition, Find All References, and the FS3885
4+
// IntelliSense, Go-to-Definition, Find All References, and the FS3887
55
// deprecation warning all flow through the IncrementalBuilder hook added
66
// in Track 05 Phase 2.
77

@@ -173,7 +173,7 @@ let main _ =
173173
assertTrue "FindReferences hits FileA (use site)" (refsInA >= 1)
174174

175175
printfn ""
176-
printfn "=== FS3885: `and` keyword deprecation under --file-order-auto+ ==="
176+
printfn "=== FS3887: `and` keyword deprecation under --file-order-auto+ ==="
177177
// Stand-up a separate single-file project to keep the deprecation case isolated.
178178
let andDir =
179179
let d = Path.Combine(Path.GetTempPath(), "fcs-ide-and-test")
@@ -195,9 +195,9 @@ and Forest = Tree list
195195
let andProj = checker.ParseAndCheckProject(andOptions) |> Async.RunSynchronously
196196
let warnings =
197197
andProj.Diagnostics
198-
|> Array.filter (fun d -> d.ErrorNumber = 3885)
199-
printfn " FS3885 warnings: %d" warnings.Length
200-
assertTrue "FS3885 surfaces under auto-order when `and` is used" (warnings.Length >= 1)
198+
|> Array.filter (fun d -> d.ErrorNumber = 3887)
199+
printfn " FS3887 warnings: %d" warnings.Length
200+
assertTrue "FS3887 surfaces under auto-order when `and` is used" (warnings.Length >= 1)
201201

202202
printfn ""
203203
if failed = 0 then

tests/file-order-auto-test/oss-sweep/RESULTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ dotnet tool install -g paket
5353
FSC=$(pwd)/../fsharp/artifacts/bin/fsc/Release/net10.0/fsc.dll # adjust
5454
dotnet build <project>.fsproj -c Release \
5555
-p:DotnetFscCompilerPath="$FSC" \
56-
-p:OtherFlags="--file-order-auto+ --nowarn:3885"
56+
-p:OtherFlags="--file-order-auto+ --nowarn:3887"
5757
```
5858

5959
## What was needed to make this work

0 commit comments

Comments
 (0)