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

Bugfix for underscore dot lambda: Forbidding expressions not based on the implied _ arg #16207

Conversation

T-Gro
Copy link
Member

@T-Gro T-Gro commented Oct 31, 2023

Addresses #16136 .

Although some of them look interesting, they should not be a hidden part of this feature, and all of them will now report an error:

This used to work in the release candidate by mistake, and will be a hard error.

(explanation: Those were all expressions, which did not make use of the implied argument to the lambda.
It produced a lambda function working on any kind of generic argument 'a, which always returned the same constant value)

let _ = _.3
let _ = _.1e-04
let _ = _."🙃"
let _ = _.[||]
let _ = _.{||}
let _ = _.typeof<int>
let _ = _.null
let _ = _.__SOURCE_DIRECTORY__
let _ = _.(<@ 1 @>)
let _ = _.(nameof nameof)
let _ = _.struct (1, 2, 3)
let _ = _.{ new System.IDisposable with member _.Dispose () = () }
let _ = _.(while true do ())
let _ = _.(let x = 3 in x + x)

@T-Gro T-Gro requested a review from a team as a code owner October 31, 2023 13:26
…d-callsindexing-are-allowed-after-_-in-dot-lambdas
T-Gro and others added 2 commits October 31, 2023 14:54
Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>
@psfinaki psfinaki changed the title Bufix for underscore dot lambda: Forbidding expressions not based on the implied _ arg Bugfix for underscore dot lambda: Forbidding expressions not based on the implied _ arg Oct 31, 2023
T-Gro added 4 commits November 1, 2023 11:48
…d-callsindexing-are-allowed-after-_-in-dot-lambdas
…xing-are-allowed-after-_-in-dot-lambdas' of https://github.com/T-Gro/fsharp into 16136-expressions-other-than-propertiesmethod-callsindexing-are-allowed-after-_-in-dot-lambdas
@psfinaki psfinaki merged commit f42bdae into dotnet:main Nov 1, 2023
24 checks passed
@T-Gro T-Gro deleted the 16136-expressions-other-than-propertiesmethod-callsindexing-are-allowed-after-_-in-dot-lambdas branch November 1, 2023 12:37
Sign up for free to 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.

5 participants