Skip to content

Don't consider parse warnings as errors in ComputeTcIntermediate #16792

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

Merged
merged 2 commits into from
Mar 1, 2024

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented Mar 1, 2024

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 warning FS0221: 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 in PostInferenceChecks to be false and no longer reporting warnings like warning 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)

image

//cc @0101

Checklist

  • Test cases added

  • Performance benchmarks added in case of performance changes

  • Release notes entry updated:

    Please make sure to add an entry with short succinct description of the change as well as link to this pull request to the respective release notes file, if applicable.

    Release notes files:

    • If anything under src/Compiler has been changed, please make sure to make an entry in docs/release-notes/.FSharp.Compiler.Service/<version>.md, where <version> is usually "highest" one, e.g. 42.8.200
    • If language feature was added (i.e. LanguageFeatures.fsi was changed), please add it to docs/releae-notes/.Language/preview.md
    • If a change to FSharp.Core was made, please make sure to edit docs/release-notes/.FSharp.Core/<version>.md where version is "highest" one, e.g. 8.0.200.

    Information about the release notes entries format can be found in the documentation.
    Example:

    If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request.

@nojaf nojaf requested a review from a team as a code owner March 1, 2024 11:09
@nojaf nojaf added the NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes label Mar 1, 2024
Copy link
Contributor

github-actions bot commented Mar 1, 2024

⚠️ Release notes required, but author opted out

Warning

Author opted out of release notes, check is disabled for this pull request.
cc @dotnet/fsharp-team-msft

@nojaf nojaf force-pushed the tc/parser-diagnostics branch from a1a1d9c to 061624b Compare March 1, 2024 11:37
Copy link
Contributor

@0101 0101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job figuring this out!

@vzarytovskii vzarytovskii merged commit 9788ff6 into dotnet:main Mar 1, 2024
@edgarfgp
Copy link
Contributor

edgarfgp commented Mar 2, 2024

I noticed the same error message if a file name has - ie A-01 while porting test from fsharp qa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants