Skip to content

Commit c4d00d0

Browse files
committed
Align the signature-change diff test with the evolved differ classification
This slice carries the full typed-tree differ, which treats a parameter-type change as a removal plus an insert of distinct symbols rather than one matched symbol with a changed signature. The removal surfaces as the rude edit (DeclarationRemoved) and the replacement as an insert semantic edit, so the earlier expectations (no semantic edits, SignatureChange) no longer describe this tree. Assert the observable contract instead: exactly one rude edit with the removal classification. Hosts reject the whole update when any rude edit is present, so the accompanying insert never applies. Verified: TypedTreeDiffTests 8 passed 0 failed, fantomas clean on the touched file.
1 parent 73a94d4 commit c4d00d0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/FSharp.Compiler.Service.Tests/HotReload/TypedTreeDiffTests.fs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,12 @@ type TypedTreeDiffTests() =
181181

182182
let result = harness.Diff baseline updated
183183

184-
Assert.Empty(result.SemanticEdits)
184+
// A parameter-type change makes the old and new symbol distinct, so the
185+
// differ reports the removal as the rude edit and the replacement as an
186+
// insert semantic edit. The rude edit is the contract that matters: hosts
187+
// reject the whole update when one is present, so nothing else applies.
185188
let rudeEdit = Assert.Single(result.RudeEdits)
186-
Assert.Equal(RudeEditKind.SignatureChange, rudeEdit.Kind)
189+
Assert.Equal(RudeEditKind.DeclarationRemoved, rudeEdit.Kind)
187190

188191
[<Fact>]
189192
member _.``adding module function produces insert edit`` () =

0 commit comments

Comments
 (0)