Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a more accurate range for CE Combine methods #18394

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

edgarfgp
Copy link
Contributor

@edgarfgp edgarfgp commented Mar 19, 2025

Description

Fixes #18422

BEFORE

type ListBuilder() =

    member this.Yield(x) = [x]

    member this.For(m,f) =
        m |> List.collect f

    member this.Combine (a,b) =
        List.concat [a;b]

    // member this.Delay(f) = f()
    
let listBuilder = new ListBuilder()

let result = listBuilder {
    let a = 10
    yield a
    ^^^^^^^
    if true then
    ^^^^^^^^^^^^
        yield 20
        ^^^^^^^^
    else
    ^^^^
        yield 30
        ^^^^^^^^
}

After

type ListBuilder() =

    member this.Yield(x) = [x]

    member this.For(m,f) =
        m |> List.collect f

    member this.Combine (a,b) =
        List.concat [a;b]

    // member this.Delay(f) = f()
    
let listBuilder = new ListBuilder()

let result = listBuilder {
    let a = 10
    yield a
    if true then
    ^^^^^^^^^^^^
        yield 20
        ^^^^^^^^
    else
    ^^^^
        yield 30
        ^^^^^^^^
}					

Checklist

  • Test cases added
  • Release notes entry updated

Copy link
Contributor

github-actions bot commented Mar 19, 2025

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/9.0.300.md

@edgarfgp edgarfgp force-pushed the improve-ce-combine-method-range branch from 35ba66b to 8b6cc00 Compare March 19, 2025 18:51
@edgarfgp edgarfgp force-pushed the improve-ce-combine-method-range branch from 8b6cc00 to 4c71580 Compare March 19, 2025 21:06
@KevinRansom
Copy link
Member

@edgarfgp
The change looks good, the tests look good. Can you add an issue for this, and the readme information. And it's probably not WIP.

Thx

@edgarfgp edgarfgp marked this pull request as ready for review March 27, 2025 16:45
@edgarfgp edgarfgp requested a review from a team as a code owner March 27, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

Improve CE Combine/Delay error reporting ranges
2 participants