Skip to content

Commit

Permalink
cherrypick #17561 - FS0243 - Unrecognized option: '--realsig- #17562 (#…
Browse files Browse the repository at this point in the history
…17563)

* Fix 17561

* tests
  • Loading branch information
KevinRansom authored Aug 20, 2024
1 parent 53ff8ee commit 6b4d1e9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 42 deletions.
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Compiler.Service/8.0.400.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 10 additions & 7 deletions src/FSharp.Build/Fsc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 <string>: Reference an F# or .NET assembly.
member _.References
Expand Down
35 changes: 0 additions & 35 deletions vsintegration/tests/UnitTests/Tests.Build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand All @@ -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 +
Expand Down Expand Up @@ -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 +
Expand Down Expand Up @@ -709,7 +676,6 @@ type Build() =
"--sig:foo.fsi"
"--keyfile:key.txt"
"--optimize+"
"--realsig+"
"--pdb:out.pdb"
"--platform:anycpu"
"--resource:MyRes.resources"
Expand Down Expand Up @@ -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 +
Expand Down

0 comments on commit 6b4d1e9

Please sign in to comment.