Don't consider parse warnings as errors in ComputeTcIntermediate #16792
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Boy this was a headscratcher:
When a file with a space in the name is the last in the project (with
--target:exe
) it will lead to parse warningFS0221: The declarations in this file will be placed in an implicit module 'As 01' based on the file name 'As 01.fs'. However, this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file o r adding a 'module' or 'namespace' declaration at the top of the file.
The transparent compiler interpreted this warning as an error, leading to
reportErrors
inPostInferenceChecks
to be false and no longer reporting warnings likewarning FS1182: The value 'b' is unused
.This PR aligns the behaviour with the background compiler, where the background compiler won't perceive the warning as error in
parseFile
(`FSharpCheckerResults.fs L2706)//cc @0101
Checklist
Test cases added
Performance benchmarks added in case of performance changes
Release notes entry updated: