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

Show overload candidates when passing wrong parameter names or types #10564

Open
Tracked by #1103
smoothdeveloper opened this issue Nov 29, 2020 · 0 comments
Open
Tracked by #1103
Labels
Area-Diagnostics mistakes and possible improvements to diagnostics Feature Request
Milestone

Comments

@smoothdeveloper
Copy link
Contributor

I propose to change this error message:

open System
DateTime(year="2020");;

error FS0507: No accessible member or object constructor named 'DateTime' takes 0 arguments. Note the call to this member also provides 1 named arguments.

into

error FS0507: No accessible member or object constructor named 'DateTime' takes 0 arguments. Note the call to this member also provides 1 named arguments.
Candidates:

  • DateTime ()
  • DateTime(ticks: int64) : DateTime
  • DateTime(ticks: int64, kind: DateTimeKind) : DateTime
  • DateTime(year: int, month: int, day: int) : DateTime
  • DateTime(year: int, month: int, day: int, calendar: Globalization.Calendar) : DateTime
  • DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int) : DateTime
  • DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, kind: DateTimeKind) : DateTime
  • DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, calendar: Globalization.Calendar) : DateTime
  • DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int) : DateTime
  • DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int, kind: DateTimeKind) : DateTime
  • DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int, calendar: Globalization.Calendar) : DateTime
  • DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int, calendar: Globalization.Calendar, kind: DateTimeKind) : DateTime

Or any better suggestion.

related: #1103 #6578

@smoothdeveloper smoothdeveloper changed the title Show overload candidates when passing wrong parameter names Show overload candidates when passing wrong parameter names or types Nov 29, 2020
@cartermp cartermp added this to the Backlog milestone Nov 29, 2020
@dsyme dsyme added the Area-Diagnostics mistakes and possible improvements to diagnostics label Apr 20, 2022
@vzarytovskii vzarytovskii moved this to Not Planned in F# Compiler and Tooling Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Diagnostics mistakes and possible improvements to diagnostics Feature Request
Projects
Status: New
Development

No branches or pull requests

3 participants