Skip to content

Commit 6b4d1e9

Browse files
authored
cherrypick #17561 - FS0243 - Unrecognized option: '--realsig- #17562 (#17563)
* Fix 17561 * tests
1 parent 53ff8ee commit 6b4d1e9

File tree

3 files changed

+11
-42
lines changed

3 files changed

+11
-42
lines changed

docs/release-notes/.FSharp.Compiler.Service/8.0.400.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* Fix for exponential runtime in CE builders when using nested implicit yields [PR #17096](https://github.com/dotnet/fsharp/pull/17096)
2020
* 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))
2121
* 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))
22+
* FS0243 - Unrecognized option: '--realsig-' #17561 ([Issue #17561](https://github.com/dotnet/fsharp/issues/17561), [PR #17268](https://github.com/dotnet/fsharp/pull/17562))
2223

2324
### Added
2425

src/FSharp.Build/Fsc.fs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ type public Fsc() as this =
5656
let mutable preferredUILang: string MaybeNull = null
5757
let mutable publicSign: bool = false
5858
let mutable provideCommandLineArgs: bool = false
59-
let mutable realsig: bool = true
59+
let mutable realsig: bool option = None
6060
let mutable references: ITaskItem[] = [||]
6161
let mutable referencePath: string MaybeNull = null
6262
let mutable refOnly: bool = false
@@ -197,10 +197,10 @@ type public Fsc() as this =
197197
builder.AppendSwitch("--optimize-")
198198

199199
// realsig
200-
if realsig then
201-
builder.AppendSwitch("--realsig+")
202-
else
203-
builder.AppendSwitch("--realsig-")
200+
match realsig with
201+
| Some true -> builder.AppendSwitch("--realsig+")
202+
| Some false -> builder.AppendSwitch("--realsig-")
203+
| None -> ()
204204

205205
// Tailcalls
206206
if not tailcalls then
@@ -544,8 +544,11 @@ type public Fsc() as this =
544544

545545
// --realsig[+-]
546546
member _.RealSig
547-
with get () = realsig
548-
and set (b) = realsig <- b
547+
with get () =
548+
match realsig with
549+
| Some true -> true
550+
| _ -> false
551+
and set (b) = realsig <- Some b
549552

550553
// -r <string>: Reference an F# or .NET assembly.
551554
member _.References

vsintegration/tests/UnitTests/Tests.Build.fs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ type Build() =
8080
AssertEqual ("--codepage:65001" + Environment.NewLine +
8181
"--compressmetadata" + Environment.NewLine +
8282
"--optimize+" + Environment.NewLine +
83-
"--realsig+" + Environment.NewLine +
8483
"--fullpaths" + Environment.NewLine +
8584
"--flaterrors" + Environment.NewLine +
8685
"--highentropyva-" + Environment.NewLine +
@@ -97,7 +96,6 @@ type Build() =
9796
AssertEqual ("-g" + Environment.NewLine +
9897
"--compressmetadata" + Environment.NewLine +
9998
"--optimize+" + Environment.NewLine +
100-
"--realsig+" + Environment.NewLine +
10199
"--fullpaths" + Environment.NewLine +
102100
"--flaterrors" + Environment.NewLine +
103101
"--highentropyva-" + Environment.NewLine +
@@ -114,7 +112,6 @@ type Build() =
114112
AssertEqual ("--debug:pdbonly" + Environment.NewLine +
115113
"--compressmetadata" + Environment.NewLine +
116114
"--optimize+" + Environment.NewLine +
117-
"--realsig+" + Environment.NewLine +
118115
"--fullpaths" + Environment.NewLine +
119116
"--flaterrors" + Environment.NewLine +
120117
"--highentropyva-" + Environment.NewLine +
@@ -133,7 +130,6 @@ type Build() =
133130
"--define:FOO=3" + Environment.NewLine +
134131
"--define:BAR=4" + Environment.NewLine +
135132
"--optimize+" + Environment.NewLine +
136-
"--realsig+" + Environment.NewLine +
137133
"--fullpaths" + Environment.NewLine +
138134
"--flaterrors" + Environment.NewLine +
139135
"--highentropyva-" + Environment.NewLine +
@@ -149,7 +145,6 @@ type Build() =
149145
printfn "cmd=\"%s\"" cmd
150146
AssertEqual ("--compressmetadata" + Environment.NewLine +
151147
"--optimize+" + Environment.NewLine +
152-
"--realsig+" + Environment.NewLine +
153148
"--nowarn:52,109" + Environment.NewLine +
154149
"--fullpaths" + Environment.NewLine +
155150
"--flaterrors" + Environment.NewLine +
@@ -166,7 +161,6 @@ type Build() =
166161
printfn "cmd=\"%s\"" cmd
167162
AssertEqual ("--compressmetadata" + Environment.NewLine +
168163
"--optimize+" + Environment.NewLine +
169-
"--realsig+" + Environment.NewLine +
170164
"--fullpaths" + Environment.NewLine +
171165
"--flaterrors" + Environment.NewLine +
172166
"--highentropyva-" + Environment.NewLine +
@@ -182,7 +176,6 @@ type Build() =
182176
printfn "cmd=\"%s\"" cmd
183177
AssertEqual ("--compressmetadata" + Environment.NewLine +
184178
"--optimize+" + Environment.NewLine +
185-
"--realsig+" + Environment.NewLine +
186179
"--warnaserror-:52,109" + Environment.NewLine +
187180
"--fullpaths" + Environment.NewLine +
188181
"--flaterrors" + Environment.NewLine +
@@ -199,7 +192,6 @@ type Build() =
199192
printfn "cmd=\"%s\"" cmd
200193
AssertEqual ("--compressmetadata" + Environment.NewLine +
201194
"--optimize+" + Environment.NewLine +
202-
"--realsig+" + Environment.NewLine +
203195
"--versionfile:src/version" + Environment.NewLine +
204196
"--fullpaths" + Environment.NewLine +
205197
"--flaterrors" + Environment.NewLine +
@@ -217,7 +209,6 @@ type Build() =
217209
AssertEqual ("--compressmetadata" + Environment.NewLine +
218210
"--doc:foo.xml" + Environment.NewLine +
219211
"--optimize+" + Environment.NewLine +
220-
"--realsig+" + Environment.NewLine +
221212
"--fullpaths" + Environment.NewLine +
222213
"--flaterrors" + Environment.NewLine +
223214
"--highentropyva-" + Environment.NewLine +
@@ -234,7 +225,6 @@ type Build() =
234225
AssertEqual ("--compressmetadata" + Environment.NewLine +
235226
"--sig:foo.fsi" + Environment.NewLine +
236227
"--optimize+" + Environment.NewLine +
237-
"--realsig+" + Environment.NewLine +
238228
"--fullpaths" + Environment.NewLine +
239229
"--flaterrors" + Environment.NewLine +
240230
"--highentropyva-" + Environment.NewLine +
@@ -251,7 +241,6 @@ type Build() =
251241
AssertEqual ("--compressmetadata" + Environment.NewLine +
252242
"--keyfile:key.txt" + Environment.NewLine +
253243
"--optimize+" + Environment.NewLine +
254-
"--realsig+" + Environment.NewLine +
255244
"--fullpaths" + Environment.NewLine +
256245
"--flaterrors" + Environment.NewLine +
257246
"--highentropyva-" + Environment.NewLine +
@@ -268,7 +257,6 @@ type Build() =
268257
AssertEqual ("--noframework" + Environment.NewLine +
269258
"--compressmetadata" + Environment.NewLine +
270259
"--optimize+" + Environment.NewLine +
271-
"--realsig+" + Environment.NewLine +
272260
"--fullpaths" + Environment.NewLine +
273261
"--flaterrors" + Environment.NewLine +
274262
"--highentropyva-" + Environment.NewLine +
@@ -284,7 +272,6 @@ type Build() =
284272
printfn "cmd=\"%s\"" cmd
285273
AssertEqual ("--compressmetadata" + Environment.NewLine +
286274
"--optimize-" + Environment.NewLine +
287-
"--realsig+" + Environment.NewLine +
288275
"--fullpaths" + Environment.NewLine +
289276
"--flaterrors" + Environment.NewLine +
290277
"--highentropyva-" + Environment.NewLine +
@@ -301,7 +288,6 @@ type Build() =
301288
// REVIEW we don't put the default, is that desired?
302289
AssertEqual ("--compressmetadata" + Environment.NewLine +
303290
"--optimize+" + Environment.NewLine +
304-
"--realsig+" + Environment.NewLine +
305291
"--fullpaths" + Environment.NewLine +
306292
"--flaterrors" + Environment.NewLine +
307293
"--highentropyva-" + Environment.NewLine +
@@ -317,7 +303,6 @@ type Build() =
317303
printfn "cmd=\"%s\"" cmd
318304
AssertEqual ("--compressmetadata" + Environment.NewLine +
319305
"--optimize+" + Environment.NewLine +
320-
"--realsig+" + Environment.NewLine +
321306
"--fullpaths" + Environment.NewLine +
322307
"--flaterrors" + Environment.NewLine +
323308
"--highentropyva-" + Environment.NewLine +
@@ -336,7 +321,6 @@ type Build() =
336321
AssertEqual ("-o:oUt.dll" + Environment.NewLine +
337322
"--compressmetadata" + Environment.NewLine +
338323
"--optimize+" + Environment.NewLine +
339-
"--realsig+" + Environment.NewLine +
340324
"--fullpaths" + Environment.NewLine +
341325
"--flaterrors" + Environment.NewLine +
342326
"--highentropyva-" + Environment.NewLine +
@@ -352,7 +336,6 @@ type Build() =
352336
printfn "cmd=\"%s\"" cmd
353337
AssertEqual ("--compressmetadata" + Environment.NewLine +
354338
"--optimize+" + Environment.NewLine +
355-
"--realsig+" + Environment.NewLine +
356339
"--pdb:out.pdb" + Environment.NewLine +
357340
"--fullpaths" + Environment.NewLine +
358341
"--flaterrors" + Environment.NewLine +
@@ -369,7 +352,6 @@ type Build() =
369352
printfn "cmd=\"%s\"" cmd
370353
AssertEqual ("--compressmetadata" + Environment.NewLine +
371354
"--optimize+" + Environment.NewLine +
372-
"--realsig+" + Environment.NewLine +
373355
"--platform:x64" + Environment.NewLine +
374356
"--fullpaths" + Environment.NewLine +
375357
"--flaterrors" + Environment.NewLine +
@@ -386,7 +368,6 @@ type Build() =
386368
printfn "cmd=\"%s\"" cmd
387369
AssertEqual ("--compressmetadata" + Environment.NewLine +
388370
"--optimize+" + Environment.NewLine +
389-
"--realsig+" + Environment.NewLine +
390371
"--platform:x86" + Environment.NewLine +
391372
"--fullpaths" + Environment.NewLine +
392373
"--flaterrors" + Environment.NewLine +
@@ -404,7 +385,6 @@ type Build() =
404385
printfn "cmd=\"%s\"" cmd
405386
AssertEqual ("--compressmetadata" + Environment.NewLine +
406387
"--optimize+" + Environment.NewLine +
407-
"--realsig+" + Environment.NewLine +
408388
"-r:" + dll + Environment.NewLine +
409389
"--fullpaths" + Environment.NewLine +
410390
"--flaterrors" + Environment.NewLine +
@@ -422,7 +402,6 @@ type Build() =
422402
printfn "cmd=\"%s\"" cmd
423403
AssertEqual ("--compressmetadata" + Environment.NewLine +
424404
"--optimize+" + Environment.NewLine +
425-
"--realsig+" + Environment.NewLine +
426405
"--lib:c:\\sd\\staging\\tools\\nunit\\,c:\\Foo" + Environment.NewLine +
427406
"--fullpaths" + Environment.NewLine +
428407
"--flaterrors" + Environment.NewLine +
@@ -440,7 +419,6 @@ type Build() =
440419
printfn "cmd=\"%s\"" cmd
441420
AssertEqual ("--compressmetadata" + Environment.NewLine +
442421
"--optimize+" + Environment.NewLine +
443-
"--realsig+" + Environment.NewLine +
444422
"--lib:c:\\program files,c:\\sd\\staging\\tools\\nunit,c:\\Foo" + Environment.NewLine +
445423
"--fullpaths" + Environment.NewLine +
446424
"--flaterrors" + Environment.NewLine +
@@ -457,7 +435,6 @@ type Build() =
457435
printfn "cmd=\"%s\"" cmd
458436
AssertEqual ("--compressmetadata" + Environment.NewLine +
459437
"--optimize+" + Environment.NewLine +
460-
"--realsig+" + Environment.NewLine +
461438
"--resource:Foo.resources" + Environment.NewLine +
462439
"--fullpaths" + Environment.NewLine +
463440
"--flaterrors" + Environment.NewLine +
@@ -476,7 +453,6 @@ type Build() =
476453
printfn "cmd=\"%s\"" cmd
477454
AssertEqual ("--compressmetadata" + Environment.NewLine +
478455
"--optimize+" + Environment.NewLine +
479-
"--realsig+" + Environment.NewLine +
480456
"--fullpaths" + Environment.NewLine +
481457
"--flaterrors" + Environment.NewLine +
482458
"--highentropyva-" + Environment.NewLine +
@@ -495,7 +471,6 @@ type Build() =
495471
printfn "cmd=\"%s\"" cmd
496472
AssertEqual ("--compressmetadata" + Environment.NewLine +
497473
"--optimize+" + Environment.NewLine +
498-
"--realsig+" + Environment.NewLine +
499474
"--target:library" + Environment.NewLine +
500475
"--fullpaths" + Environment.NewLine +
501476
"--flaterrors" + Environment.NewLine +
@@ -512,7 +487,6 @@ type Build() =
512487
printfn "cmd=\"%s\"" cmd
513488
AssertEqual ("--compressmetadata" + Environment.NewLine +
514489
"--optimize+" + Environment.NewLine +
515-
"--realsig+" + Environment.NewLine +
516490
"--target:winexe" + Environment.NewLine +
517491
"--fullpaths" + Environment.NewLine +
518492
"--flaterrors" + Environment.NewLine +
@@ -529,7 +503,6 @@ type Build() =
529503
printfn "cmd=\"%s\"" cmd
530504
AssertEqual ("--compressmetadata" + Environment.NewLine +
531505
"--optimize+" + Environment.NewLine +
532-
"--realsig+" + Environment.NewLine +
533506
"--target:module" + Environment.NewLine +
534507
"--fullpaths" + Environment.NewLine +
535508
"--flaterrors" + Environment.NewLine +
@@ -545,7 +518,6 @@ type Build() =
545518
printfn "cmd=\"%s\"" cmd
546519
AssertEqual ("--compressmetadata" + Environment.NewLine +
547520
"--optimize+" + Environment.NewLine +
548-
"--realsig+" + Environment.NewLine +
549521
"--utf8output" + Environment.NewLine +
550522
"--fullpaths" + Environment.NewLine +
551523
"--flaterrors" + Environment.NewLine +
@@ -561,7 +533,6 @@ type Build() =
561533
printfn "cmd=\"%s\"" cmd
562534
AssertEqual ("--compressmetadata" + Environment.NewLine +
563535
"--optimize+" + Environment.NewLine +
564-
"--realsig+" + Environment.NewLine +
565536
"--win32res:foo.res" + Environment.NewLine +
566537
"--fullpaths" + Environment.NewLine +
567538
"--flaterrors" + Environment.NewLine +
@@ -577,7 +548,6 @@ type Build() =
577548
printfn "cmd=\"%s\"" cmd
578549
AssertEqual ("--compressmetadata" + Environment.NewLine +
579550
"--optimize+" + Environment.NewLine +
580-
"--realsig+" + Environment.NewLine +
581551
"--win32manifest:foo.manifest" + Environment.NewLine +
582552
"--fullpaths" + Environment.NewLine +
583553
"--flaterrors" + Environment.NewLine +
@@ -593,7 +563,6 @@ type Build() =
593563
printfn "cmd=\"%s\"" cmd
594564
AssertEqual ("--compressmetadata" + Environment.NewLine +
595565
"--optimize+" + Environment.NewLine +
596-
"--realsig+" + Environment.NewLine +
597566
"--fullpaths" + Environment.NewLine +
598567
"--flaterrors" + Environment.NewLine +
599568
"--highentropyva+" + Environment.NewLine +
@@ -608,7 +577,6 @@ type Build() =
608577
printfn "cmd=\"%s\"" cmd
609578
AssertEqual ("--compressmetadata" + Environment.NewLine +
610579
"--optimize+" + Environment.NewLine +
611-
"--realsig+" + Environment.NewLine +
612580
"--fullpaths" + Environment.NewLine +
613581
"--flaterrors" + Environment.NewLine +
614582
"--subsystemversion:6.02" + Environment.NewLine +
@@ -664,7 +632,6 @@ type Build() =
664632
"--sig:foo.fsi" + Environment.NewLine +
665633
"--keyfile:key.txt" + Environment.NewLine +
666634
"--optimize+" + Environment.NewLine +
667-
"--realsig+" + Environment.NewLine +
668635
"--pdb:out.pdb" + Environment.NewLine +
669636
"--platform:anycpu" + Environment.NewLine +
670637
"--resource:MyRes.resources" + Environment.NewLine +
@@ -709,7 +676,6 @@ type Build() =
709676
"--sig:foo.fsi"
710677
"--keyfile:key.txt"
711678
"--optimize+"
712-
"--realsig+"
713679
"--pdb:out.pdb"
714680
"--platform:anycpu"
715681
"--resource:MyRes.resources"
@@ -754,7 +720,6 @@ type Build() =
754720
let expected =
755721
"--compressmetadata" + Environment.NewLine +
756722
"--optimize+" + Environment.NewLine +
757-
"--realsig+" + Environment.NewLine +
758723
"--nowarn:52,109,110,73,85" + Environment.NewLine +
759724
"--fullpaths" + Environment.NewLine +
760725
"--flaterrors" + Environment.NewLine +

0 commit comments

Comments
 (0)