dotnet / dotnet/fsharp

Type checking is cancelled on parsing errors in the compiler compilations

Open
#18,454 1 comment 0 reactions 0 assignees View on GitHub
Area-Diagnostics Area-LangService-Diagnostics Feature Improvement
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 8h
Merged PRs (30d)
133

Description

While adding tests to #18311, I've noticed two things about reporting type checker errors:

* Type checker errors are [not reported](https://github.com/dotnet/fsharp/blob/a9f59cd4e55d7853e1f05e88e7a3d1ac2479c674/tests/FSharp.Test.Utilities/CompilerAssert.fs#L811) in the component tests when there're any parsing errors
* This makes it less suitable for testing the compiler service, since the errors are actually produced and reported there. This behavior is, however, inline with the actual compiler (not the service), so it's not clear what is the desired option here

* The compiler [stops](https://github.com/dotnet/fsharp/blob/e92bb80d7eb1c312159f077141ce9293e784032a/src/Compiler/Driver/fsc.fs#L563) when encountering syntax errors. It makes failing builds fail faster, but is it the behavior that we want? I.e. when there's a parser error, it seems that unrelated type checker errors are not going to be reported. I think reporting all known errors, like we do in the service, would be much more helpful with fixing these errors.

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.