Commits

Michael Garnett committed d7737eb

Fix for static RPC functions with more than 3 arguments.
Added tests for instance-based and static methods taking 3 and 4 arguments.

Comments (0)

Files changed (2)

IntelliFactory.WebSharper.Core/Invocation.fs

         else
             fun t args -> i.Func (t :: List.ofArray args)
     | _ ->
+        let ts = if info.IsStatic then typeof<obj> :: ts else ts
         let k = ts.Length
         fun t xs ->
             let args = t :: List.ofArray xs

IntelliFactory.WebSharper.Web.Tests/Remoting.fs

         [<Remote>]
         abstract member M5 : int -> int -> Async<int>
 
+        [<Remote>]
+        abstract member M6 : int -> int -> int -> Async<int>
+
+        [<Remote>]
+        abstract member M7: int -> int -> int -> int -> Async<int>
+
     type Handler() =
         interface IHandler with
 
             member this.M5 a b =
                 async.Return (a + b)
 
+            member this.M6 a b c =
+                async.Return (a + b + c)
+
+            member this.M7 a b c d =
+                async.Return (a + b + c + d)
+
     let Initialize () =
         SetRpcHandlerFactory {
             new IRpcHandlerFactory with
     [<Remote>]
     let count () = async.Return counter.Value
 
+    [<Remote>]
+    let f15 (a:string) (b:string) (c:string) =
+        a + b + c
+        |> async.Return
+
+    [<Remote>]
+    let f16 (a:string) (b:string) (c:string) (d:string) =
+        a + b + c + d
+        |> async.Return
+
 type Harness [<JavaScript>] () =
     let mutable expected = 0
     let mutable executed = 0
             do! satisfy (Server.f14 {X = "X"}) (fun x ->
                 x.Body = "X!")
 
+            do test "string -> string -> string -> Async<string>"
+            do! Server.f15 "Aee" "Bee" "Cee" =? "AeeBeeCee"
+
+            do test "string -> string -> string -> string -> Async<string>"
+            do! Server.f16 "Aee" "Bee" "Cee" "Dee" =? "AeeBeeCeeDee"
+
             do test "M1"
             do Remote<Server.IHandler>.M1()
             do! Server.sleep()
             do test "M5"
             do! Remote<Server.IHandler>.M5 3 6 =? 9
 
+            do test "M6"
+            do! Remote<Server.IHandler>.M6 1 2 3 =? 6
+
+            do test "M7"
+            do! Remote<Server.IHandler>.M7 1 19 20 2 =? 42
+
             do test "reverse"
             do! Server.reverse "abc#quit;;" =? ";;tiuq#cba"
             do! Server.reverse "c#" =? "#c"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.