Skip to content

Conversation

@T-Gro
Copy link
Member

@T-Gro T-Gro commented Feb 12, 2026

Debug point / sequence point fixes

  • Fixes Extra sequence point at the end of match expressions #12052 — Extra sequence point at end of match expressions caused debugger to briefly stop at unrelated branches during Step Over. Fixed by always emitting hidden code at decision tree join points in IlxGen.fs, not only when the stack is non-empty. Also covers the if/elif/else case mentioned in the comments. Tests: MatchEndSequencePoint.fs (5 tests including if/then/else).

  • Fixes Wrong sequence point range for return inside async computation expression #19248return, yield, return!, yield! in CEs had debug points covering only the keyword range instead of the full expression (e.g. return instead of return 1). Fixed by using the full expression range (mFull) for DebugPointAtLeafExpr in CheckComputationExpressions.fs. Tests: CEDebugPoints.fs (6 tests covering return, yield, return!, yield! in async/task/custom CEs).

  • Fixes Extra out-of-order sequence point for use in task computation expressions #19255use bindings in task CEs emitted an extra out-of-order sequence point (nop at the use line before let on the prior line), making execution appear to jump backwards. Fixed by using mBind instead of leadingKeyword.Range for the Using call and switching DebugPointAtTarget to No. Tests: CEDebugPoints.fs (Use in task CE test).

  • Fixes Debug points failing to bind in body of "[ for x in xs -> body ]" #13504 — Debug points failed to bind in [ for x in xs -> body ] arrow comprehensions. The SeqMap pattern in LowerComputedCollections.fs was stripping debug points from the loop body during lowering. Fixed by preserving them via DebugPoints active pattern. Tests: ForArrowDebugPoints.fs (3 tests: list, array, and for-do-yield contrast).

T-Gro added 6 commits February 8, 2026 16:39
Breakpoints inside 'for x in xs -> body' (arrow syntax in list/array/seq
comprehensions) failed to bind because the SeqMap active pattern in
LowerComputedCollections.fs did not preserve debug point wrappers.

Fix: wrap body extraction in DebugPoints and return 'debug body', matching
the existing SeqCollectSingle pattern.

Add 3 tests verifying debug points exist on body expressions for list arrow,
array arrow, and do-yield comprehension forms.
  range (e.g., 'return 1' not just 'return') by using mFull instead of
  keyword-only range m in DebugPointAtLeafExpr.Yes

- Fix use binding in CE to use DebugPointAtTarget.No on the SynMatchClause
  to avoid generating an extra sequence point from the match target

- Add VerifyMethodSequencePoints test infrastructure to verify sequence
  points for specific methods (e.g., Invoke, MoveNext, GenerateNext)

- Add CEDebugPoints test module with 3 tests validating the fixes
- Fix compiler: use full binding range (mBind) instead of keyword-only range
  (leadingKeyword.Range) in mkSynCall for 'use' CE translation, eliminating
  the use-keyword-only sequence point in state machine output.
- Extract verifyCEMethodDebugPoints helper to reduce test boilerplate.
- Change use test from async/Invoke to task/MoveNext for single-method SP
  validation in the state machine.
- Update expected SP values to match actual compiler output.
- All 3 CEDebugPoints tests pass; PortablePdbs, ForArrowDebugPoints, and
  AsyncExpressionStepping regression tests pass.
@github-actions
Copy link
Contributor

❗ Release notes required


✅ Found changes and release notes in following paths:

Warning

No PR link found in some release notes, please consider adding it.

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/10.0.300.md No current pull request URL (#19278) found, please consider adding it

@T-Gro T-Gro marked this pull request as ready for review February 12, 2026 17:01
@T-Gro T-Gro requested a review from a team as a code owner February 12, 2026 17:01
@T-Gro T-Gro changed the title WIP :: Bugfix :: Sequence points Bugfix :: Sequence points Feb 12, 2026
@T-Gro T-Gro requested a review from abonie February 12, 2026 17:03
@T-Gro T-Gro force-pushed the bugfix/sequence-points branch from 38c2f6e to 1ce8e10 Compare February 12, 2026 22:43
@T-Gro
Copy link
Member Author

T-Gro commented Feb 12, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@T-Gro
Copy link
Member Author

T-Gro commented Feb 12, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@T-Gro
Copy link
Member Author

T-Gro commented Feb 12, 2026

/azp run fsharp-ci

@azure-pipelines
Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@T-Gro
Copy link
Member Author

T-Gro commented Feb 12, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

1 participant