dotnet / dotnet/fsharp

Improve error reporting: Use before definition within files and across whole project

Open
#12,341 6 comments 6 reactions 0 assignees View on GitHub
Area-Diagnostics Feature Improvement Theme-Simple-F#
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

We should give good and clear diagnostics on "use before definition" both within a single file and across the whole project.

The F# compiler parses all files in the project before checking anything. The compiler service can also be adjusted to parse all files

Given that, it's easy to extract all potential top-level symbols across all files (and the language service has some of those)

If an undefined symbol appears in this set, we can thus give much better diagnsotics, explaining to the user that they need to define functions before they use them.

This is perhaps the most important diagnostic we need to implement, as research by @cartermp showed that this problem was the most common confusion and rejection point for those learning F#.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.