Skip to content

The Terminal's compiler service is checked rather than warned about (#1100) - #1132

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
the-terminals-compiler-service-is-checked-rather-than-warned-about
Aug 31, 2026
Merged

The Terminal's compiler service is checked rather than warned about (#1100)#1132
Rafael-SOWNet merged 1 commit into
masterfrom
the-terminals-compiler-service-is-checked-rather-than-warned-about

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Collaborator

Closes #1100, which asked for "an hour of someone running the Terminal against something non-trivial" rather than a fix.

The answer: it is benign

A kernel built on the shipped pair — FSharp.Compiler.Service 43.9.300 beside FSharp.Core 10.1 — compiles sixteen of sixteen language features that the compiler service has to implement rather than the parser fold:

generic functions, inference, inline constraints
records, discriminated unions, classes with members, units of measure
async, sequence expressions, list comprehensions
active patterns, tuple destructuring, Option
recursion, sprintf, string interpolation, object expression over an interface

And it still refuses what it should — a type error and a syntax error, each with the position the Terminal shows to whoever typed it. A compiler that accepted everything would pass the first sixteen and be useless, so that half is asserted too.

What changed, and why it is not just a suppression

The warning is suppressed, and the claim it was making now lives in CompilerServiceWorksTest. That is the point of the change rather than a side effect. A warning nobody reads is not a check, and this one had been passing through CI unread for two releases at sixteen occurrences a run. If FSharp.Core or FSharp.Compiler.Service moves and the pair really does come apart, a test fails — where before a sixteen-line warning would have scrolled past again.

InteractiveTest.yml already runs TerminalUnitTests, so this gates on every PR touching it.

Suppressing rather than pinning, because the constraint cannot be met. The 10.1 is the FSharp.Core the F# SDK references implicitly for every F# project; satisfying FSharp.Compiler.Service's = 9.0.300 would mean pinning two majors back, against the SDK, across the whole graph.

The .fsproj comment records what was measured and says the test is what to believe if the versions move.

Measured

before now
dotnet pack, NU1608 16 0
dotnet pack, NuGet warnings of any kind 16 0
TerminalUnitTests 7 pass 28 pass

One thing found on the way, filed separately

The tests use a bare kernel deliberately. The Terminal opens AngouriMath.Interactive.AggressiveOperators over the top, which rebinds < > <= >= = <> to build expressions — that is the tool's whole point, and it means ordinary F# containing a comparison does not typecheck once AngouriMath is enabled:

let rec fib n = if n < 2 then n else fib (n-1) + fib (n-2)
  -> typecheck error: expected 'bool' but here has type 'Entity'

Same for if 1 < 2 then … and List.filter (fun x -> x > 1). That is a deliberate design trade-off rather than a defect of this pairing, so it is filed as its own issue rather than smuggled in here.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

NU1608 has said on every Terminal publish since 2.3.0 that FSharp.Compiler.Service 43.9.300 wants
FSharp.Core 9.0.300 and got 10.1, sixteen times per run, and nobody had checked which of the two
readings was right. #1100 asked for an hour of running the Terminal against something non-trivial.

**It is benign.** A kernel built on the shipped pair compiles generic functions and inference,
records, discriminated unions, classes with members, units of measure, async, sequence expressions,
list comprehensions, active patterns, tuple destructuring, recursion, `sprintf`, string
interpolation, `inline` generic constraints and an object expression over an interface: sixteen of
sixteen. It also still refuses a type error and a syntax error, each with the position the Terminal
shows to whoever typed it -- a compiler that accepted everything would pass the first sixteen and be
useless.

So the warning is suppressed, and the claim it was making is carried by `CompilerServiceWorksTest`
instead. That is the point of the change rather than a side effect: a warning nobody reads is not a
check, and this one had been passing through CI unread for two releases. If FSharp.Core or
FSharp.Compiler.Service moves and the pair really does come apart, a test fails where before a
sixteen-line warning would have scrolled past again.

The constraint cannot be met, which is why suppressing is the option rather than pinning: the 10.1
is the FSharp.Core the F# SDK references implicitly for every F# project, and satisfying
FSharp.Compiler.Service would mean pinning two majors back, against the SDK, across the graph.

Measured: 16 NU1608 on `dotnet pack` before, 0 after, and 0 NuGet warnings of any kind on the
publish path.

The tests use a bare kernel deliberately. The Terminal opens `AggressiveOperators` over the top,
which rebinds the comparison operators to build expressions, and that is the tool's whole point --
but it means `if a < b then` does not typecheck in the Terminal, which is a separate question and is
filed as one rather than smuggled in here.

Part of #1100.
@Rafael-SOWNet
Rafael-SOWNet merged commit 2fdcc9e into master Aug 31, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AngouriMath.Terminal ships FSharp.Core 10.1 against a compiler service that requires 9.0.300 (NU1608)

1 participant