Skip to content

Transparent compiler doesn't respect #nowarn in test. - #16638

Closed
nojaf wants to merge 2 commits into
dotnet:mainfrom
nojaf:no-warn-kinda-warns-in-transparent-compiler
Closed

Transparent compiler doesn't respect #nowarn in test.#16638
nojaf wants to merge 2 commits into
dotnet:mainfrom
nojaf:no-warn-kinda-warns-in-transparent-compiler

Conversation

@nojaf

@nojafnojaf commented Feb 1, 2024

Copy link
Copy Markdown
Contributor

Description

This is more of an issue than a PR but:

I'm able to compile this fsc "@Foo.rsp both with and without --test:GraphBasedChecking.
However, running this from TypeCheck last file in project with transparent compiler doesn't work for me with the transparent compiler.

I get

image

while Foo.fs has the #nowarn "40"

moduleMehletbar(name:string):'a = failwith<'a>"todo"#nowarn"40"typeFoo()=member__.Bar(name :string):unit ->'a =let recprov:(unit -> 'a) ref = ref (fun()->letp:(unit -> 'a) = bar name
prov := p
p())fun()->(!prov)()

Fixes # (issue, if applicable)

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 ownerFebruary 1, 2024 15:46
@github-actions

Copy link
Copy Markdown
Contributor

✅ No release notes required

@0101

0101 commented Feb 1, 2024

Copy link
Copy Markdown
Contributor

Yeah it's a bug. ApplyNoWarnsToTcConfig(TcConfig, ParseTree, fileName) has to happen at the correct time, which gives us correct diagnostics options.

Currently this is only handled in ParseAndCheckFileInProject but not in ComputeParseAndCheckProject. It might be a bit more tricky there since we need to process each file separately.

@nojaf

Copy link
Copy Markdown
ContributorAuthor

Closing in favour of #16667
Great work @dawedawe!

@nojafnojaf closed this Feb 12, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants

@nojaf@0101