diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md
index 70920a02872..30759268928 100644
--- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md
+++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md
@@ -1,6 +1,7 @@
### Added
* Add opt-in warning attribute not valid for union case with fields [PR #18532](https://github.com/dotnet/fsharp/pull/18532))
* Add support for `when 'T : Enum` library-only static optimization constraint. ([PR #18546](https://github.com/dotnet/fsharp/pull/18546))
+* Add `--typecheck-only` flag support for F# Interactive (FSI) scripts to type-check without execution. ([Issue #18686](https://github.com/dotnet/fsharp/issues/18686))
### Fixed
diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs
index cdeda6b6566..4dd36dec6bd 100644
--- a/src/Compiler/Driver/CompilerOptions.fs
+++ b/src/Compiler/Driver/CompilerOptions.fs
@@ -1308,6 +1308,13 @@ let advancedFlagsFsi tcConfigB =
None,
Some(FSComp.SR.optsClearResultsCache ())
)
+ CompilerOption(
+ "typecheck-only",
+ tagNone,
+ OptionUnit(fun () -> tcConfigB.typeCheckOnly <- true),
+ None,
+ Some(FSComp.SR.optsTypecheckOnly ())
+ )
]
let advancedFlagsFsc tcConfigB =
diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt
index f259f06cac0..6a243373521 100644
--- a/src/Compiler/FSComp.txt
+++ b/src/Compiler/FSComp.txt
@@ -902,6 +902,7 @@ optsVersion,"Display compiler version banner and exit"
optsResponseFile,"Read response file for more options"
optsCodepage,"Specify the codepage used to read source files"
optsClearResultsCache,"Clear the package manager results cache"
+optsTypecheckOnly,"Perform type checking only, do not execute code"
optsUtf8output,"Output messages in UTF-8 encoding"
optsFullpaths,"Output messages with fully qualified paths"
optsLib,"Specify a directory for the include path which is used to resolve source files and assemblies (Short form: -I)"
diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs
index 662ba9752e7..8b09f86fb4d 100644
--- a/src/Compiler/Interactive/fsi.fs
+++ b/src/Compiler/Interactive/fsi.fs
@@ -2217,6 +2217,11 @@ type internal FsiDynamicCompiler
inputs
))
+ // typeCheckOnly either reports all errors found so far or exits with 0 - it stops processing the script
+ if tcConfig.typeCheckOnly then
+ diagnosticsLogger.AbortOnError(fsiConsoleOutput)
+ raise StopProcessing
+
let codegenResults, optEnv, fragName =
ProcessTypedImpl(
diagnosticsLogger,
@@ -4763,6 +4768,7 @@ type FsiEvaluationSession
let userRes =
match res with
| Choice1Of2 r -> Choice1Of2 r
+ | Choice2Of2 None when errorInfos.Length = 0 && tcConfigB.typeCheckOnly -> Choice1Of2 None
| Choice2Of2 None ->
Choice2Of2(FsiCompilationException(FSIstrings.SR.fsiOperationCouldNotBeCompleted (), Some errorInfos) :> exn)
| Choice2Of2(Some userExn) -> Choice2Of2 userExn
diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf
index bb56261f125..1b8318e124e 100644
--- a/src/Compiler/xlf/FSComp.txt.cs.xlf
+++ b/src/Compiler/xlf/FSComp.txt.cs.xlf
@@ -1057,6 +1057,11 @@
Podporované jazykové verze:
+
+ Perform type checking only, do not execute code
+ Perform type checking only, do not execute code
+
+ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress.Neplatná hodnota '{0}' pro --optimizationdata, platná hodnota: none, file, compress.
diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf
index 7b8d6567c1c..b1045b18823 100644
--- a/src/Compiler/xlf/FSComp.txt.de.xlf
+++ b/src/Compiler/xlf/FSComp.txt.de.xlf
@@ -1057,6 +1057,11 @@
Unterstützte Sprachversionen:
+
+ Perform type checking only, do not execute code
+ Perform type checking only, do not execute code
+
+ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress.Ungültiger Wert „{0}“ für --optimizationdata. Gültige Werte sind: none, file, compress.
diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf
index 8a0ac83a342..c76e6d0bcac 100644
--- a/src/Compiler/xlf/FSComp.txt.es.xlf
+++ b/src/Compiler/xlf/FSComp.txt.es.xlf
@@ -1057,6 +1057,11 @@
Versiones de lenguaje admitidas:
+
+ Perform type checking only, do not execute code
+ Perform type checking only, do not execute code
+
+ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress.Valor no válido '{0}' para --optimizationdata; los valores válidos son: none, file, compress.
diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf
index 621813988a3..aa49f56b951 100644
--- a/src/Compiler/xlf/FSComp.txt.fr.xlf
+++ b/src/Compiler/xlf/FSComp.txt.fr.xlf
@@ -1057,6 +1057,11 @@
Versions linguistiques prises en charge :
+
+ Perform type checking only, do not execute code
+ Perform type checking only, do not execute code
+
+ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress.Valeur non valide '{0}' pour --optimizationdata. Les valeurs valides sont : none, file, compress.
diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf
index 76294e7ac7f..89dacdf42ac 100644
--- a/src/Compiler/xlf/FSComp.txt.it.xlf
+++ b/src/Compiler/xlf/FSComp.txt.it.xlf
@@ -1057,6 +1057,11 @@
Versioni del linguaggio supportate:
+
+ Perform type checking only, do not execute code
+ Perform type checking only, do not execute code
+
+ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress.Valore non valido '{0}' per --optimizationdata. Valori validi sono: none, file, compress.
diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf
index cf31f12757e..42955cb462b 100644
--- a/src/Compiler/xlf/FSComp.txt.ja.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ja.xlf
@@ -1057,6 +1057,11 @@
サポートされる言語バージョン:
+
+ Perform type checking only, do not execute code
+ Perform type checking only, do not execute code
+
+ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress.--optimizationdata の値 '{0}' が無効です。有効な値は none、file、compress です。
diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf
index 70f312b88cd..56628072e04 100644
--- a/src/Compiler/xlf/FSComp.txt.ko.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ko.xlf
@@ -1057,6 +1057,11 @@
지원되는 언어 버전:
+
+ Perform type checking only, do not execute code
+ Perform type checking only, do not execute code
+
+ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress.--optimizationdata에 대한 '{0}' 값이 잘못되었습니다. 올바른 값은 none, file, compress입니다.
diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf
index 5cb379287e1..4cee71af6e0 100644
--- a/src/Compiler/xlf/FSComp.txt.pl.xlf
+++ b/src/Compiler/xlf/FSComp.txt.pl.xlf
@@ -1057,6 +1057,11 @@
Obsługiwane wersje językowe:
+
+ Perform type checking only, do not execute code
+ Perform type checking only, do not execute code
+
+ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress.Nieprawidłowa wartość „{0}” dla parametru --optimizationdata, prawidłowa wartość to: none, file, compress.
diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
index 8f67095285e..44685a5bf83 100644
--- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
+++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
@@ -1057,6 +1057,11 @@
Versões de linguagens com suporte:
+
+ Perform type checking only, do not execute code
+ Perform type checking only, do not execute code
+
+ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress.Valor inválido '{0}' para --optimizationdata, o valor válido é: none, file, compact.
diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf
index 19de2b0d1a9..c9056c01054 100644
--- a/src/Compiler/xlf/FSComp.txt.ru.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ru.xlf
@@ -1057,6 +1057,11 @@
Поддерживаемые языковые версии:
+
+ Perform type checking only, do not execute code
+ Perform type checking only, do not execute code
+
+ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress.Недопустимое значение "{0}" для --optimizationdata. Допустимые значения: none, file, compress.
diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf
index eb357aaa843..e39ae57407c 100644
--- a/src/Compiler/xlf/FSComp.txt.tr.xlf
+++ b/src/Compiler/xlf/FSComp.txt.tr.xlf
@@ -1057,6 +1057,11 @@
Desteklenen dil sürümleri:
+
+ Perform type checking only, do not execute code
+ Perform type checking only, do not execute code
+
+ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress.--optimizationdata için geçersiz '{0}' değeri, geçerli değerler: none, file, compress.
diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
index 256302b235e..08d5772f30d 100644
--- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
+++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
@@ -1057,6 +1057,11 @@
支持的语言版本:
+
+ Perform type checking only, do not execute code
+ Perform type checking only, do not execute code
+
+ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress.--optimizationdata 的值 "{0}" 无效,有效值为: none、file、compress。
diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
index 674e3ee9c45..4e6690ce1fe 100644
--- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
+++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
@@ -1057,6 +1057,11 @@
支援的語言版本:
+
+ Perform type checking only, do not execute code
+ Perform type checking only, do not execute code
+
+ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress.--optimizationdata 的 '{0}' 值無效,有效值為: none、file、compress。
diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj
index f0cb13ea71e..9618f9cbcee 100644
--- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj
+++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj
@@ -273,6 +273,7 @@
+
diff --git a/tests/FSharp.Compiler.ComponentTests/Scripting/TypeCheckOnlyTests.fs b/tests/FSharp.Compiler.ComponentTests/Scripting/TypeCheckOnlyTests.fs
new file mode 100644
index 00000000000..703a6326293
--- /dev/null
+++ b/tests/FSharp.Compiler.ComponentTests/Scripting/TypeCheckOnlyTests.fs
@@ -0,0 +1,47 @@
+module FSharp.Compiler.ComponentTests.Scripting.TypeCheckOnlyTests
+
+open Xunit
+open FSharp.Test
+open FSharp.Test.Compiler
+
+[]
+let ``typecheck-only flag works for valid script``() =
+ Fsx """
+let x = 42
+printfn "This should not execute"
+exit 999 // this would have crashed if really running
+"""
+ |> withOptions ["--typecheck-only"]
+ |> runFsi
+ |> shouldSucceed
+
+[]
+let ``typecheck-only flag catches type errors``() =
+ Fsx """
+let x: int = "string" // Type error
+"""
+ |> withOptions ["--typecheck-only"]
+ |> runFsi
+ |> shouldFail
+ |> withStdErrContains """This expression was expected to have type"""
+
+[]
+let ``typecheck-only flag prevents execution side effects``() =
+ Fsx """
+printfn "MyCrazyString"
+let x = 42
+"""
+ |> withOptions ["--typecheck-only"]
+ |> runFsi
+ |> shouldSucceed
+ |> verifyNotInOutput "MyCrazyString"
+
+[]
+let ``script executes without typecheck-only flag``() =
+ Fsx """
+let x = 21+21
+"""
+ |> withOptions ["--nologo"]
+ |> runFsi
+ |> shouldSucceed
+ |> verifyOutputContains [|"val x: int = 42"|]
\ No newline at end of file
diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs
index 2d0695c7369..d0d19195275 100644
--- a/tests/FSharp.Test.Utilities/Compiler.fs
+++ b/tests/FSharp.Test.Utilities/Compiler.fs
@@ -1471,6 +1471,15 @@ Actual:
failwith $"""Output does not match expected:{Environment.NewLine}{item}{Environment.NewLine}Actual:{Environment.NewLine}{actual}{Environment.NewLine}"""
cResult
+ let verifyNotInOutput (expected: string) (cResult: CompilationResult) : CompilationResult =
+ match getOutput cResult with
+ | None -> cResult
+ | Some actual ->
+ if actual.Contains(expected) then
+ failwith $"""Output should not contain:{Environment.NewLine}{expected}{Environment.NewLine}Actual:{Environment.NewLine}{actual}{Environment.NewLine}"""
+ else
+ cResult
+
type ImportScope = { Kind: ImportDefinitionKind; Name: string }
type PdbVerificationOption =
diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl
index c7384a6c7ba..496515c023d 100644
--- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl
+++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl
@@ -21,7 +21,7 @@
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack.
-[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-813::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack.
+[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3499-813::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack.
[IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@106::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type.
[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-515::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack.
diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl
index 756a6fa55d7..e3eb5d75f65 100644
--- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl
+++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl
@@ -28,7 +28,7 @@
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000039][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack.
-[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-813::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack.
+[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3499-813::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x0000001B][found Char] Unexpected type on the stack.
[IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@106::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type.
[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack.
diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl
index dba0e14f752..ed3f064766f 100644
--- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl
+++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl
@@ -21,7 +21,7 @@
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack.
-[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-851::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack.
+[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3499-851::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack.
diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl
index b2afcae84a3..4ea9408c317 100644
--- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl
+++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl
@@ -28,7 +28,7 @@
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000032][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack.
-[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-851::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack.
+[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3499-851::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x00000024][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack.
diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl
index b8e35227384..bd4d89ab9ac 100644
--- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl
+++ b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl
@@ -105,6 +105,8 @@ Usage: fsiAnyCpu [script.fsx []]
Default - mscorlib
--clearResultsCache Clear the package manager results
cache
+--typecheck-only Perform type checking only, do not
+ execute code
--exec Exit fsi after loading the files or
running the .fsx script given on the
command line
diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl
index 7c8c9a4f4ba..ce50a9e5e5d 100644
--- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl
+++ b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl
@@ -107,6 +107,8 @@ Usage: fsiAnyCpu [script.fsx []]
Default - mscorlib
--clearResultsCache Clear the package manager results
cache
+--typecheck-only Perform type checking only, do not
+ execute code
--exec Exit fsi after loading the files or
running the .fsx script given on the
command line