diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md index 60394d22e23..d4dad08b83a 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md @@ -19,6 +19,7 @@ * Fix for exponential runtime in CE builders when using nested implicit yields [PR #17096](https://github.com/dotnet/fsharp/pull/17096) * Fix several AND operator parser bugs and regressions ([Issue #16447](https://github.com/dotnet/fsharp/issues/16447), [Issue #17134](https://github.com/dotnet/fsharp/issues/17134), [Issue #16309](https://github.com/dotnet/fsharp/issues/16309), [PR #17113](https://github.com/dotnet/fsharp/pull/17113)) * Treat exceptions as types in a namespace for graph based type checking ([Issue #17262](https://github.com/dotnet/fsharp/issues/17262), [PR #17268](https://github.com/dotnet/fsharp/pull/17268)) +* FS0243 - Unrecognized option: '--realsig-' #17561 ([Issue #17561](https://github.com/dotnet/fsharp/issues/17561), [PR #17268](https://github.com/dotnet/fsharp/pull/17562)) ### Added diff --git a/src/FSharp.Build/Fsc.fs b/src/FSharp.Build/Fsc.fs index 24952eceea1..0f4048a9280 100644 --- a/src/FSharp.Build/Fsc.fs +++ b/src/FSharp.Build/Fsc.fs @@ -56,7 +56,7 @@ type public Fsc() as this = let mutable preferredUILang: string MaybeNull = null let mutable publicSign: bool = false let mutable provideCommandLineArgs: bool = false - let mutable realsig: bool = true + let mutable realsig: bool option = None let mutable references: ITaskItem[] = [||] let mutable referencePath: string MaybeNull = null let mutable refOnly: bool = false @@ -197,10 +197,10 @@ type public Fsc() as this = builder.AppendSwitch("--optimize-") // realsig - if realsig then - builder.AppendSwitch("--realsig+") - else - builder.AppendSwitch("--realsig-") + match realsig with + | Some true -> builder.AppendSwitch("--realsig+") + | Some false -> builder.AppendSwitch("--realsig-") + | None -> () // Tailcalls if not tailcalls then @@ -544,8 +544,11 @@ type public Fsc() as this = // --realsig[+-] member _.RealSig - with get () = realsig - and set (b) = realsig <- b + with get () = + match realsig with + | Some true -> true + | _ -> false + and set (b) = realsig <- Some b // -r : Reference an F# or .NET assembly. member _.References diff --git a/vsintegration/tests/UnitTests/Tests.Build.fs b/vsintegration/tests/UnitTests/Tests.Build.fs index bd1b88bcf6e..3c58fc3b63e 100644 --- a/vsintegration/tests/UnitTests/Tests.Build.fs +++ b/vsintegration/tests/UnitTests/Tests.Build.fs @@ -80,7 +80,6 @@ type Build() = AssertEqual ("--codepage:65001" + Environment.NewLine + "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -97,7 +96,6 @@ type Build() = AssertEqual ("-g" + Environment.NewLine + "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -114,7 +112,6 @@ type Build() = AssertEqual ("--debug:pdbonly" + Environment.NewLine + "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -133,7 +130,6 @@ type Build() = "--define:FOO=3" + Environment.NewLine + "--define:BAR=4" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -149,7 +145,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--nowarn:52,109" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -166,7 +161,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -182,7 +176,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--warnaserror-:52,109" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -199,7 +192,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--versionfile:src/version" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -217,7 +209,6 @@ type Build() = AssertEqual ("--compressmetadata" + Environment.NewLine + "--doc:foo.xml" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -234,7 +225,6 @@ type Build() = AssertEqual ("--compressmetadata" + Environment.NewLine + "--sig:foo.fsi" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -251,7 +241,6 @@ type Build() = AssertEqual ("--compressmetadata" + Environment.NewLine + "--keyfile:key.txt" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -268,7 +257,6 @@ type Build() = AssertEqual ("--noframework" + Environment.NewLine + "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -284,7 +272,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize-" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -301,7 +288,6 @@ type Build() = // REVIEW we don't put the default, is that desired? AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -317,7 +303,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -336,7 +321,6 @@ type Build() = AssertEqual ("-o:oUt.dll" + Environment.NewLine + "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -352,7 +336,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--pdb:out.pdb" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -369,7 +352,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--platform:x64" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -386,7 +368,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--platform:x86" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -404,7 +385,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "-r:" + dll + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -422,7 +402,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--lib:c:\\sd\\staging\\tools\\nunit\\,c:\\Foo" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -440,7 +419,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--lib:c:\\program files,c:\\sd\\staging\\tools\\nunit,c:\\Foo" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -457,7 +435,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--resource:Foo.resources" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -476,7 +453,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -495,7 +471,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--target:library" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -512,7 +487,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--target:winexe" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -529,7 +503,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--target:module" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -545,7 +518,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--utf8output" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -561,7 +533,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--win32res:foo.res" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -577,7 +548,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--win32manifest:foo.manifest" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -593,7 +563,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva+" + Environment.NewLine + @@ -608,7 +577,6 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--subsystemversion:6.02" + Environment.NewLine + @@ -664,7 +632,6 @@ type Build() = "--sig:foo.fsi" + Environment.NewLine + "--keyfile:key.txt" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--pdb:out.pdb" + Environment.NewLine + "--platform:anycpu" + Environment.NewLine + "--resource:MyRes.resources" + Environment.NewLine + @@ -709,7 +676,6 @@ type Build() = "--sig:foo.fsi" "--keyfile:key.txt" "--optimize+" - "--realsig+" "--pdb:out.pdb" "--platform:anycpu" "--resource:MyRes.resources" @@ -754,7 +720,6 @@ type Build() = let expected = "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--nowarn:52,109,110,73,85" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine +