Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ let z : unit =
failwithf "did not expect expression for 'z': %A" e
"""
|> asExe
|> withOptions ["--langversion:preview"]
|> withPreview
|> compileAndRun
|> shouldSucceed
5 changes: 5 additions & 0 deletions tests/FSharp.Test.Utilities/Compiler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ module rec Compiler =
| FS fs -> FS { fs with Options = options }
| _ -> failwith "withOptions is only supported n F#"

let withPreview (cUnit: CompilationUnit) : CompilationUnit =
match cUnit with
| FS fs -> FS { fs with Options = [ "--langversion:preview" ] }
| _ -> failwith "withPreview is only supported in F#"

let asLibrary (cUnit: CompilationUnit) : CompilationUnit =
match cUnit with
| FS fs -> FS { fs with OutputType = CompileOutput.Library }
Expand Down
2 changes: 1 addition & 1 deletion tests/fsharp/Compiler/Language/WitnessTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module WitnessTests =
""" (dir ++ "provider.fsx"))
|> asExe
|> ignoreWarnings
|> withOptions ["--langversion:preview"]
|> withPreview
|> compile
|> shouldSucceed
|> ignore
Expand Down