Skip to content

Commit 4f78d3b

Browse files
committed
Fix 631
1 parent f09e4aa commit 4f78d3b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/fsharp/fsi/fsi.fs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2314,7 +2314,7 @@ let internal DriveFsiEventLoop (fsi: FsiEvaluationSessionHostConfig, fsiConsoleO
23142314

23152315
/// The primary type, representing a full F# Interactive session, reading from the given
23162316
/// text input, writing to the given text output and error writers.
2317-
type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], inReader:TextReader, outWriter:TextWriter, errorWriter: TextWriter, fsiCollectible: bool, msbuildEnabled: bool, checker: FSharpChecker) =
2317+
type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], inReader:TextReader, outWriter:TextWriter, errorWriter: TextWriter, fsiCollectible: bool, msbuildEnabled: bool) =
23182318
#if DYNAMIC_CODE_REWRITES_CONSOLE_WRITE
23192319
do
23202320
Microsoft.FSharp.Core.Printf.setWriter outWriter
@@ -2454,6 +2454,10 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i
24542454

24552455
let fsiConsoleInput = FsiConsoleInput(fsi, fsiOptions, inReader, outWriter)
24562456

2457+
/// The single, global interactive checker that can be safely used in conjunction with other operations
2458+
/// on the FsiEvaluationSession.
2459+
let checker = FSharpChecker.Create(msbuildEnabled=msbuildEnabled)
2460+
24572461
let (tcGlobals,frameworkTcImports,nonFrameworkResolutions,unresolvedReferences) =
24582462
try
24592463
let tcConfig = tcConfigP.Get()
@@ -2714,12 +2718,8 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i
27142718
GC.KeepAlive fsiInterruptController.EventHandlers
27152719

27162720

2717-
static member Create(fsiConfig, argv, inReader, outWriter, errorWriter, ?collectible, ?msbuildEnabled, ?checker) =
2718-
/// The single, global interactive checker that can be safely used in conjunction with other operations
2719-
/// on the FsiEvaluationSession.
2720-
let checker = match checker with None -> FSharpChecker.Create() | Some c -> c
2721-
2722-
new FsiEvaluationSession(fsiConfig, argv, inReader, outWriter, errorWriter, defaultArg collectible false, defaultArg msbuildEnabled true, checker)
2721+
static member Create(fsiConfig, argv, inReader, outWriter, errorWriter, ?collectible, ?msbuildEnabled) =
2722+
new FsiEvaluationSession(fsiConfig, argv, inReader, outWriter, errorWriter, defaultArg collectible false, defaultArg msbuildEnabled true)
27232723

27242724
static member GetDefaultConfiguration(fsiObj:obj) = FsiEvaluationSession.GetDefaultConfiguration(fsiObj, true)
27252725

src/fsharp/fsi/fsi.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ type FsiEvaluationSession =
124124
/// <param name="inReader">Read input from the given reader</param>
125125
/// <param name="outWriter">Write output to the given writer</param>
126126
/// <param name="collectible">Optionally make the dynamic assmbly for the session collectible</param>
127-
static member Create : fsiConfig: FsiEvaluationSessionHostConfig * argv:string[] * inReader:TextReader * outWriter:TextWriter * errorWriter: TextWriter * ?collectible: bool * ?msbuildEnabled: bool * ?checker: FSharpChecker -> FsiEvaluationSession
127+
static member Create : fsiConfig: FsiEvaluationSessionHostConfig * argv:string[] * inReader:TextReader * outWriter:TextWriter * errorWriter: TextWriter * ?collectible: bool * ?msbuildEnabled: bool -> FsiEvaluationSession
128128

129129
/// A host calls this to request an interrupt on the evaluation thread.
130130
member Interrupt : unit -> unit

0 commit comments

Comments
 (0)