Skip to content

Commit

Permalink
Fix #361: Warn at compile time when using synchronous RPC
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmil committed Mar 10, 2015
1 parent 558dc76 commit da54fe2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/compiler/WebSharper.Compiler/Verifier.fs
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ type State(logger: Logger) =
| None ->
match m.ReturnType with
| None -> Correct
| Some (Async t) | Some t ->
| Some (Async t) ->
if canEncodeToJson t
then Correct
else Incorrect "Cannot encode the return type to JSON."
| Some t -> Incorrect "Synchronous remote methods are strongly advised against; consider returning an Async<'T> instead."

let getWebControlError (t: TypeDefinition) : Status =
if not (canEncodeToJson t) then
Expand Down

0 comments on commit da54fe2

Please sign in to comment.