Skip to content

[RFC FS-1151] Record spreads - #805

Open
brianrourkeboll wants to merge 1 commit into
fsharp:mainfrom
brianrourkeboll:spread
Open

[RFC FS-1151] Record spreads#805
brianrourkeboll wants to merge 1 commit into
fsharp:mainfrom
brianrourkeboll:spread

Conversation

@brianrourkeboll

@brianrourkeboll brianrourkeboll commented Jul 11, 2025

Copy link
Copy Markdown
Contributor

RFC for the record-to-record spreads subset of the approved language suggestion fsharp/fslang-suggestions#1253.

Click “Files changed” → “⋯” → “View file” for the rendered RFC.

@brianrourkeboll brianrourkeboll changed the title [RFC FS-1151] Spread operator for F# [RFC FS-1151] Spread operator for records Jul 22, 2026
Comment thread RFCs/FS-1151-spread-operator.md Outdated
Comment thread RFCs/FS-1151-spread-operator.md Outdated
@brianrourkeboll brianrourkeboll changed the title [RFC FS-1151] Spread operator for records [RFC FS-1151] Record spreads Jul 25, 2026
@brianrourkeboll
brianrourkeboll force-pushed the spread branch 9 times, most recently from 5bfad58 to d462616 Compare July 28, 2026 12:11
@brianrourkeboll
brianrourkeboll marked this pull request as ready for review July 28, 2026 12:25
@brianrourkeboll

Copy link
Copy Markdown
Contributor Author

@dsyme This is ready for review.

@Happypig375

Happypig375 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor
type A = { a : int; b : int }
type B = { a : int } with member this.b = this.a + 1
let b = { a = 1 }
let a : A = { ...b } // should this work? how about properties brought in via type extension?
let c = {| ...b |} // and then this ignores properties?

@brianrourkeboll

brianrourkeboll commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author
type A = { a : int; b : int }
type B = { a : int } with member this.b = this.a + 1
let b = { a = 1 }
let a : A = { ...b } // should this work? how about properties brought in via type extension?
let c = {| ...b |} // and then this ignores properties?

Only record fields participate in spreads: other instance, static, or extension members are ignored.

And #806 (comment).

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.

3 participants