{"action":"created","issue":{"url":"https://api.github.com/repos/akkadotnet/akka.net/issues/1317","labels_url":"https://api.github.com/repos/akkadotnet/akka.net/issues/1317/labels{/name}","comments_url":"https://api.github.com/repos/akkadotnet/akka.net/issues/1317/comments","events_url":"https://api.github.com/repos/akkadotnet/akka.net/issues/1317/events","html_url":"https://github.com/akkadotnet/akka.net/pull/1317","id":106928888,"number":1317,"title":"Added tests for F# null bug","user":{"login":"rogeralsing","id":647031,"avatar_url":"https://avatars.githubusercontent.com/u/647031?v=3","gravatar_id":"","url":"https://api.github.com/users/rogeralsing","html_url":"https://github.com/rogeralsing","followers_url":"https://api.github.com/users/rogeralsing/followers","following_url":"https://api.github.com/users/rogeralsing/following{/other_user}","gists_url":"https://api.github.com/users/rogeralsing/gists{/gist_id}","starred_url":"https://api.github.com/users/rogeralsing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rogeralsing/subscriptions","organizations_url":"https://api.github.com/users/rogeralsing/orgs","repos_url":"https://api.github.com/users/rogeralsing/repos","events_url":"https://api.github.com/users/rogeralsing/events{/privacy}","received_events_url":"https://api.github.com/users/rogeralsing/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/akkadotnet/akka.net/labels/needs%20review","name":"needs review","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-17T07:49:57Z","updated_at":"2015-09-21T16:18:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/akkadotnet/akka.net/pulls/1317","html_url":"https://github.com/akkadotnet/akka.net/pull/1317","diff_url":"https://github.com/akkadotnet/akka.net/pull/1317.diff","patch_url":"https://github.com/akkadotnet/akka.net/pull/1317.patch"},"body":"This PR contains the F# tests that @raymens created in #1285\r\n\r\nThe failing test is commented out for now.\r\n@Horusiath the actual problem is in here:\r\n\r\n```fsharp\r\n   let private tryCast (t:Task<obj>) : 'Message =\r\n        match t.Result with\r\n        | :? 'Message as m -> m\r\n        | o ->                         //<------------- here, if the user Tells () to an actorref, the () will not be matched by the above line as it is not of that type. \r\n                                         //instead the unit will be processed here, as a JObject, which it is not..\r\n                                         //my F#-fu is not strong enough to know how to deal with the F# type system :-/\r\n\r\n            let context = Akka.Actor.Internal.InternalCurrentActorCellKeeper.Current\r\n            if context = null \r\n            then failwith \"Cannot cast JObject outside the actor system context \"\r\n            else\r\n                let serializer = context.System.Serialization.FindSerializerForType typeof<'Message> :?> Akka.Serialization.NewtonSoftJsonSerializer\r\n                match Serialization.tryDeserializeJObject serializer.Serializer o with\r\n                | Some m -> m\r\n                | None -> raise (InvalidCastException(\"Tried to cast JObject to \" + typeof<'Message>.ToString()))\r\n```\r\n\r\nSo we either need to fix this, or just decide that we should not be able to pass () to F# actors\r\n"},"comment":{"url":"https://api.github.com/repos/akkadotnet/akka.net/issues/comments/142032080","html_url":"https://github.com/akkadotnet/akka.net/pull/1317#issuecomment-142032080","issue_url":"https://api.github.com/repos/akkadotnet/akka.net/issues/1317","id":142032080,"user":{"login":"rodrigovidal","id":388081,"avatar_url":"https://avatars.githubusercontent.com/u/388081?v=3","gravatar_id":"","url":"https://api.github.com/users/rodrigovidal","html_url":"https://github.com/rodrigovidal","followers_url":"https://api.github.com/users/rodrigovidal/followers","following_url":"https://api.github.com/users/rodrigovidal/following{/other_user}","gists_url":"https://api.github.com/users/rodrigovidal/gists{/gist_id}","starred_url":"https://api.github.com/users/rodrigovidal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodrigovidal/subscriptions","organizations_url":"https://api.github.com/users/rodrigovidal/orgs","repos_url":"https://api.github.com/users/rodrigovidal/repos","events_url":"https://api.github.com/users/rodrigovidal/events{/privacy}","received_events_url":"https://api.github.com/users/rodrigovidal/received_events","type":"User","site_admin":false},"created_at":"2015-09-21T16:18:06Z","updated_at":"2015-09-21T16:18:06Z","body":"@rogeralsing @Aaronontheweb I've investigated this a little bit. In the case of the test that fails it doesn't seem to even reach the \"tryCast\" function. I removed the timeout configuration, and it just hang forever in the .Result.\r\n\r\n@rogeralsing Have you experienced a different behavior?"}}