@@ -2497,6 +2497,7 @@ module TestAutoQuoteAtStaticMethodCalls =
24972497
24982498module TestAutoQuoteAtInstanceMethodCalls =
24992499open Microsoft.FSharp .Quotations
2500+ open System.Runtime .CompilerServices
25002501
25012502
25022503type C () =
@@ -2528,7 +2529,32 @@ module TestAutoQuoteAtInstanceMethodCalls =
25282529member __.PlotEval ( [<ReflectedDefinition( true ) >] x : Expr < 'T >) =
25292530 sprintf" %A " x|> cleanup
25302531
2532+ override __.ToString () = " C"
25312533
2534+ [<Extension>]
2535+ module CSharpStyleExtensionMember =
2536+ let cleanup ( s : string ) = s.Replace( " " , " " ) .Replace( " \n " , " " ) .Replace( " \r " , " " )
2537+ [<Extension>]
2538+ type CExtMem () =
2539+ [<Extension>]
2540+ static member PlotCSharpStyleExtMem ( this : C , [<ReflectedDefinition>] x : Expr < 'T >) =
2541+ sprintf" %A " x|> cleanup
2542+
2543+ // Adding 'ReflectedDefinition' to an argument that doesn't have type Expr<'T> is ignored (no error or warning is given at declaration or use)
2544+ [<Extension>]
2545+ static member PlotCSharpStyleExtMemNoExpr ( this : C , [<ReflectedDefinition>] x : 'T ) =
2546+ sprintf" %A " x|> cleanup
2547+
2548+ // Adding 'ReflectedDefinition' to the 'this' argument of a C#-style extension member is ignored.
2549+ //
2550+ //[<Extension>]
2551+ //static member PlotCSharpStyleExtMemWithReflectedThis ([<ReflectedDefinition>] this: Expr<C>, [<ReflectedDefinition>] x: Expr<'T>) =
2552+ // sprintf "%A" (this, x) |> cleanup
2553+ [<Extension>]
2554+ static member PlotCSharpStyleExtMemWithIgnoredReflectedThis ( [<ReflectedDefinition>] this : C , [<ReflectedDefinition>] x : Expr < 'T >) =
2555+ sprintf" %A " ( this, x) |> cleanup
2556+
2557+ open CSharpStyleExtensionMember
25322558let shouldEqual id x y = check id y x
25332559let x = 1
25342560let y = 1
@@ -2579,6 +2605,12 @@ module TestAutoQuoteAtInstanceMethodCalls =
25792605
25802606 c.PlotEval( xb&& yb|| zb) |> shouldEqual" testd109712" " WithValue(true,IfThenElse(IfThenElse(PropertyGet(None,xb,[]),PropertyGet(None,yb,[]),Value(false)),Value(true),ValueWithName(true,zb)))"
25812607
2608+ c.PlotCSharpStyleExtMem( xb&& yb|| zb) |> shouldEqual" testd109713" " IfThenElse(IfThenElse(PropertyGet(None,xb,[]),PropertyGet(None,yb,[]),Value(false)),Value(true),ValueWithName(true,zb))"
2609+
2610+ c.PlotCSharpStyleExtMemNoExpr( xb&& yb|| zb) |> shouldEqual" testdoqhwm" " true"
2611+
2612+ c.PlotCSharpStyleExtMemWithIgnoredReflectedThis( xb&& yb|| zb) |> shouldEqual" testd109714" " (C,IfThenElse(IfThenElse(PropertyGet(None,xb,[]),PropertyGet(None,yb,[]),Value(false)),Value(true),ValueWithName(true,zb)))"
2613+
25822614 testItAll()
25832615
25842616let aa =