File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed
FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -325,28 +325,23 @@ module ``Type checking behavior`` =
325325 #if ! NETCOREAPP
326326 [<Theory( Skip = " IWSAMs are not supported by NET472." ) >]
327327 #else
328- [<InlineData( """
328+ [<InlineData( " 6.0" ) >]
329+ [<InlineData( " 7.0" ) >]
330+ [<Theory>]
331+ #endif
332+ let ``Extension method on interface without SAM does not produce a warning`` version =
333+ Fsx """
329334 type INormalInterface =
330335 abstract member IntMember: int
331336
332337 module INormalInterfaceExtensions =
333338 type INormalInterface with
334339 static member ExtMethod (a: INormalInterface) =
335- ()""" ) >]
336- [<Theory>]
337- #endif
338- let ``Extension method on interface without SAM does not produce a warning`` code =
339- Fsx code
340- |> withLangVersion60
341- |> compile
342- |> shouldSucceed
343- |> ignore
344-
345- Fsx code
346- |> withLangVersion70
340+ ()
341+ """
342+ |> withLangVersion version
347343 |> compile
348344 |> shouldSucceed
349- |> ignore
350345
351346module Negative =
352347
Original file line number Diff line number Diff line change @@ -393,6 +393,9 @@ module rec Compiler =
393393
394394 let withLangVersionPreview ( cUnit : CompilationUnit ) : CompilationUnit =
395395 withOptionsHelper [ " --langversion:preview" ] " withLangVersionPreview is only supported on F#" cUnit
396+
397+ let withLangVersion ( version : string ) ( cUnit : CompilationUnit ) : CompilationUnit =
398+ withOptionsHelper [ $" --langversion:{version}" ] " withLangVersion is only supported on F#" cUnit
396399
397400 let withAssemblyVersion ( version : string ) ( cUnit : CompilationUnit ) : CompilationUnit =
398401 withOptionsHelper [ $" --version:{version}" ] " withAssemblyVersion is only supported on F#" cUnit
You can’t perform that action at this time.
0 commit comments