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

Tracking Error reporting improvements #1103

Open
44 of 81 tasks
isaacabraham opened this issue Apr 24, 2016 · 29 comments
Open
44 of 81 tasks

Tracking Error reporting improvements #1103

isaacabraham opened this issue Apr 24, 2016 · 29 comments
Labels
Analyzers Area-Diagnostics mistakes and possible improvements to diagnostics Feature Improvement Theme-Simple-F# A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language. Tracking
Milestone

Comments

@isaacabraham
Copy link
Contributor

isaacabraham commented Apr 24, 2016

Related to #1102, this issue could act as an overall list for all the issues relating to error reporting from the compiler. I'll start the ball rolling by adding the ones mentioned in that issue plus a few more.

Up for grabs!

More discussion / on hold

Implemented!

Rejected

Contributing

If you have ideas for other error messages, please adhere to the following standard for new issues: -

  1. Title the issue "Improve Error Reporting: "

  2. Each issue should have the following elements: -

    a. What - reproduction of the error through a code snippet and compiler error / warning.
    b. Why - why the current compiler error / warning is insufficient.
    c. How - how you would improve the current error / warning with an alternative example.

@enricosada
Copy link
Contributor

i just want to add a ref to ocaml error reporting improvements, it's really nice

@isaacabraham
Copy link
Contributor Author

Another good source for ideas of potential issues: http://fsharpforfunandprofit.com/troubleshooting-fsharp/

@vilinski
Copy link

Missing method XYFooBar --> may be you need an FSharp.Core redirect

@isaacabraham
Copy link
Contributor Author

@vilinski can you raise an issue for this and maybe give a concrete example of where this happens?

@dsyme
Copy link
Contributor

dsyme commented Apr 26, 2016

That's a good list.

I'd like to see each of the issues above have a few lines of justification addressing why we believe the error message is specifically a problem for beginners (e.g. they might be coming with expectations from Python or C#)

@isaacabraham
Copy link
Contributor Author

@dsyme done.

@dsyme
Copy link
Contributor

dsyme commented Jun 22, 2016

@isaacabraham One error you might like to consider is a much better error message when a C# or C++ programmer uses !expr to mean "not". F# interprets that at "dereference a ref cell".

Now, as of F# 4.0, the use of explicit ref cells is far less common because implicit promotion of let mutable is now so well supported. We could probably even consider deprecating the use of !expr as the default syntax and instead ask people to either use not expr or expr.Value.

But even without going that far, we could surely improve the error message for a misuse of !expr in the common case, asking people to use not expr instead (perhaps with parentheses as in not (f x))

Can I leave it to you to add the specific issue for this?

@forki
Copy link
Contributor

forki commented Jun 22, 2016

@dsyme WIP: #1275

@isaacabraham
Copy link
Contributor Author

@forki what's the status of #1109 and #1218? Any way we can unblock these?

@forki
Copy link
Contributor

forki commented Aug 15, 2016

I need help from @dsyme - I already contacted him

2016-08-15 18:46 GMT+02:00 Isaac Abraham [email protected]:

@forki https://github.com/forki what's the status of #1109
#1109 and #1218
#1218? Any way we can
unblock these?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1103 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNAYSq9iFBEHF3byxTkmp-oimwQTFks5qgJfqgaJpZM4IOdcd
.

@LyndonGingerich
Copy link

Is #1431 still in state "More discussion / on hold"? It is closed as completed.

@0101
Copy link
Contributor

0101 commented Jul 18, 2022

@LyndonGingerich it's done. I moved it into the Implemented list.

@jkone27
Copy link
Contributor

jkone27 commented May 8, 2023

sorry if this is a not relevant remark or already adressed, maybe is already adressed by one of the proposals, but checking Rust error messages now and they are really awesome

image

but maybe is the same already referenced here? support code previews? Rust is really nice on error messages
#14832

@ShalokShalom
Copy link
Contributor

sorry if this is a not relevant remark or already adressed, maybe is already adressed by one of the proposals, but checking Rust error messages now and they are really awesome

image

but maybe is the same already referenced here? support code previews? Rust is really nice on error messages #14832

I know that we spoke about this in the F# Discord, and it was said that the implementation of something like this relies on dotnet tooling, that is still in the works.

@voronoipotato
Copy link
Contributor

voronoipotato commented Sep 28, 2023

@vzarytovskii hello, I made a suggestion about a confusing error message fsharp/fslang-suggestions#1324 here. Bent redirected me here. Trying to make sure I do this right. Should this suggestion be an dotnet/fsharp issue here?

@vzarytovskii
Copy link
Member

Yeah, I think diagnostics improvements are fine in this repo

@voronoipotato
Copy link
Contributor

voronoipotato commented Sep 28, 2023

Okay I'll probably have to tackle this after work, running out of lunch time :), also could you fix the title :( improvenets should be improvements, I can't stop thinking about it. Unless it's a pun, in which case 'ha'.

psfinaki pushed a commit to psfinaki/fsharp that referenced this issue Dec 15, 2023
psfinaki added a commit that referenced this issue Dec 18, 2023
* Improve value restriction error message #1103

* Update the error message

* Update message

* Update tests

* Update error message

* Update messages

* Add line back

* Update error messages

* Update E_ValueRestriction01.fs

* Update messages

* Update messages

* Update messages

* Does this work?

* hmm

* Update function message

* Escape ()

* Update tests

* Update messages

* Update CompilerDiagnostics.fs

* Update CompilerDiagnostics.fs

---------

Co-authored-by: Petr <[email protected]>
OwnageIsMagic added a commit to OwnageIsMagic/fsharp that referenced this issue Dec 21, 2023
* upstream/main: (166 commits)
  typo in foldBack summary (dotnet#16453)
  Fix for dotnet#83 (improve constraint error message) (dotnet#16304)
  Name resolution: resolve interfaces in expressions (dotnet#15660)
  AddExplicitReturnType refactoring (dotnet#16077)
  Disabling 2 tests: running for too long, causing CI timeouts
  Improve value restriction error message dotnet#1103 (dotnet#15877)
  Parens: Keep parens for non-identical infix operator pairs with same precedence (dotnet#16372)
  More release note entries (dotnet#16438)
  Using Ordinal is both faster and more correct as our intent is to do … (dotnet#16439)
  merge (dotnet#16427)
  Optimize empty string compares (dotnet#16435)
  Checker: recover on unresolved type in 'inherit' member (dotnet#16429)
  Release notes proposal (dotnet#16377)
  [main] Update dependencies from dotnet/source-build-reference-packages (dotnet#16411)
  Allow usage of [<TailCall>] with older FSharp.Core package versions (dotnet#16373)
  Parser: recover on unfinished 'as' patterns (dotnet#16404)
  Parens: Keep parens in method calls in dot-lambdas (dotnet#16395)
  Checker: check unfinished obj expression inside computations (dotnet#16413)
  Added default dotnet-tools + additional tasks to launch them (dotnet#16409)
  make `remarks` and `returns` visible in quick info (dotnet#16417)
  ...
@vzarytovskii vzarytovskii reopened this Jan 4, 2024
@github-project-automation github-project-automation bot moved this from Done to In Progress in F# Compiler and Tooling Jan 4, 2024
@isaacabraham isaacabraham changed the title Tracking Error reporting improvenets Tracking Error reporting improvements Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Analyzers Area-Diagnostics mistakes and possible improvements to diagnostics Feature Improvement Theme-Simple-F# A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language. Tracking
Projects
Archived in project
Development

No branches or pull requests