File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed
FSharp.Compiler.ComponentTests/Language Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,6 @@ let z : unit =
3636 failwithf "did not expect expression for 'z': %A " e
3737 """
3838 |> asExe
39- |> withOptions [ " --langversion:preview " ]
39+ |> withPreview
4040 |> compileAndRun
4141 |> shouldSucceed
Original file line number Diff line number Diff line change @@ -176,6 +176,11 @@ module rec Compiler =
176176 | FS fs -> FS { fs with Options = options }
177177 | _ -> failwith " withOptions is only supported n F#"
178178
179+ let withPreview ( cUnit : CompilationUnit ) : CompilationUnit =
180+ match cUnit with
181+ | FS fs -> FS { fs with Options = [ " --langversion:preview" ] }
182+ | _ -> failwith " withPreview is only supported in F#"
183+
179184 let asLibrary ( cUnit : CompilationUnit ) : CompilationUnit =
180185 match cUnit with
181186 | FS fs -> FS { fs with OutputType = CompileOutput.Library }
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ module WitnessTests =
1919 """ ( dir ++ " provider.fsx" ))
2020 |> asExe
2121 |> ignoreWarnings
22- |> withOptions [ " --langversion:preview " ]
22+ |> withPreview
2323 |> compile
2424 |> shouldSucceed
2525 |> ignore
You can’t perform that action at this time.
0 commit comments