Skip to content

Use a more accurate range for CE Combine methods - #18394

Merged
T-Gro merged 11 commits into
dotnet:mainfrom
edgarfgp:improve-ce-combine-method-range
Mar 31, 2025
Merged

Use a more accurate range for CE Combine methods#18394
T-Gro merged 11 commits into
dotnet:mainfrom
edgarfgp:improve-ce-combine-method-range

Conversation

@edgarfgp

@edgarfgpedgarfgp commented Mar 19, 2025

Copy link
Copy Markdown
Contributor

Description

Fixes#18422

BEFORE

typeListBuilder()=memberthis.Yield(x)=[x]memberthis.For(m,f)=
m |> List.collect f
memberthis.Combine(a,b)=
List.concat [a;b]// member this.Delay(f) = f()letlistBuilder=new ListBuilder()letresult= listBuilder {leta=10yield a
^^^^^^^iftruethen^^^^^^^^^^^^yield20^^^^^^^^else^^^^yield30^^^^^^^^}

After

typeListBuilder()=memberthis.Yield(x)=[x]memberthis.For(m,f)=
m |> List.collect f
memberthis.Combine(a,b)=
List.concat [a;b]// member this.Delay(f) = f()letlistBuilder=new ListBuilder()letresult= listBuilder {leta=10yield a
iftruethen^^^^^^^^^^^^yield20^^^^^^^^else^^^^yield30^^^^^^^^}

Checklist

  • Test cases added
  • Release notes entry updated

@github-actions

github-actionsBot commented Mar 19, 2025

Copy link
Copy Markdown
Contributor

❗ Release notes required


✅ Found changes and release notes in following paths:

Change pathRelease notes pathDescription
src/Compilerdocs/release-notes/.FSharp.Compiler.Service/9.0.300.md

@edgarfgp
edgarfgpforce-pushed the improve-ce-combine-method-range branch from 35ba66b to 8b6cc00CompareMarch 19, 2025 18:51
@edgarfgp
edgarfgpforce-pushed the improve-ce-combine-method-range branch from 8b6cc00 to 4c71580CompareMarch 19, 2025 21:06
@KevinRansom

Copy link
Copy Markdown
Contributor

@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 ownerMarch 27, 2025 16:45

@psfinakipsfinaki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff. Thank you Edgar!

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

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Improve CE Combine/Delay error reporting ranges

4 participants

@edgarfgp@KevinRansom@psfinaki@T-Gro