{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/orleans/issues/1352","repository_url":"https://api.github.com/repos/dotnet/orleans","labels_url":"https://api.github.com/repos/dotnet/orleans/issues/1352/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/orleans/issues/1352/comments","events_url":"https://api.github.com/repos/dotnet/orleans/issues/1352/events","html_url":"https://github.com/dotnet/orleans/issues/1352","id":129754496,"number":1352,"title":"Generic Grain Methods","user":{"login":"Joshua-Ferguson","id":7284858,"avatar_url":"https://avatars.githubusercontent.com/u/7284858?v=3","gravatar_id":"","url":"https://api.github.com/users/Joshua-Ferguson","html_url":"https://github.com/Joshua-Ferguson","followers_url":"https://api.github.com/users/Joshua-Ferguson/followers","following_url":"https://api.github.com/users/Joshua-Ferguson/following{/other_user}","gists_url":"https://api.github.com/users/Joshua-Ferguson/gists{/gist_id}","starred_url":"https://api.github.com/users/Joshua-Ferguson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joshua-Ferguson/subscriptions","organizations_url":"https://api.github.com/users/Joshua-Ferguson/orgs","repos_url":"https://api.github.com/users/Joshua-Ferguson/repos","events_url":"https://api.github.com/users/Joshua-Ferguson/events{/privacy}","received_events_url":"https://api.github.com/users/Joshua-Ferguson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"ReubenBond","id":203839,"avatar_url":"https://avatars.githubusercontent.com/u/203839?v=3","gravatar_id":"","url":"https://api.github.com/users/ReubenBond","html_url":"https://github.com/ReubenBond","followers_url":"https://api.github.com/users/ReubenBond/followers","following_url":"https://api.github.com/users/ReubenBond/following{/other_user}","gists_url":"https://api.github.com/users/ReubenBond/gists{/gist_id}","starred_url":"https://api.github.com/users/ReubenBond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReubenBond/subscriptions","organizations_url":"https://api.github.com/users/ReubenBond/orgs","repos_url":"https://api.github.com/users/ReubenBond/repos","events_url":"https://api.github.com/users/ReubenBond/events{/privacy}","received_events_url":"https://api.github.com/users/ReubenBond/received_events","type":"User","site_admin":false},"assignees":[{"login":"ReubenBond","id":203839,"avatar_url":"https://avatars.githubusercontent.com/u/203839?v=3","gravatar_id":"","url":"https://api.github.com/users/ReubenBond","html_url":"https://github.com/ReubenBond","followers_url":"https://api.github.com/users/ReubenBond/followers","following_url":"https://api.github.com/users/ReubenBond/following{/other_user}","gists_url":"https://api.github.com/users/ReubenBond/gists{/gist_id}","starred_url":"https://api.github.com/users/ReubenBond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReubenBond/subscriptions","organizations_url":"https://api.github.com/users/ReubenBond/orgs","repos_url":"https://api.github.com/users/ReubenBond/repos","events_url":"https://api.github.com/users/ReubenBond/events{/privacy}","received_events_url":"https://api.github.com/users/ReubenBond/received_events","type":"User","site_admin":false}],"milestone":null,"comments":12,"created_at":"2016-01-29T12:39:04Z","updated_at":"2016-10-03T16:43:11Z","closed_at":null,"body":"I created an Orleans grain with a generic method call and I noticed that codegen failed. I'm not sure if it should fail on generics (intentional for performance reasons, or user error?). I created a [PR](https://github.com/Joshua-Ferguson/orleans/pull/1) on a fork to show the changes I made to get generics working. But I'm not sure the changes are made are the best way to do it (really just wanted to be able to test that it could be done). I got the type info < T > passed where I could and used < dynamic > everywhere else.\r\n\r\n    public interface ISecretNinjaTestGrain : IGrainWithIntegerKey\r\n    {\r\n        Task<int> FakeGeneric<T>();\r\n        Task<int> GenericArg<T>(T data);\r\n        Task<T> SimpleGeneric<T>();\r\n        Task<int> SimpleGenericInteger<T>();\r\n        Task<int> SimpleInteger();\r\n        Task<T> VeryGeneric<T>(T data);\r\n        Task<string> MultiGeneric<T, T2, T3>(T t, T2 t2, T3 t3);\r\n        Task<T2> BreakDance<T, T2, T3>(T t, T2 t2, T3 t3);\r\n        Task<T> LessSimpleGeneric<T>(T one, T two);\r\n    }\r\n\r\n    public class SecretNinjaTestGrain : Grain, ISecretNinjaTestGrain\r\n    {\r\n        public Task<int> SimpleInteger() => Task.FromResult(3);\r\n        public Task<int> SimpleGenericInteger<T>() => Task.FromResult(3);\r\n        public Task<T> SimpleGeneric<T>() => Task.FromResult(default(T));\r\n        public Task<T> LessSimpleGeneric<T>(T one, T two) => Task.FromResult(default(T));\r\n        public Task<int> FakeGeneric<T>() => Task.FromResult(3);\r\n        public Task<int> GenericArg<TDifferent>(TDifferent data) => Task.FromResult(3);\r\n        public Task<T> VeryGeneric<T>(T data) => Task.FromResult(data);\r\n        public Task<string> MultiGeneric<T, T2, T3>(T t, T2 t2, T3 t3) => Task.FromResult($\"{t}{t2}{t3}\");\r\n        public Task<T2> BreakDance<T, T2, T3>(T t, T2 t2, T3 t3) => Task.FromResult(default(T2));\r\n    }\r\n\r\nI was able to make calls to all these methods.\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/orleans/issues/comments/251158073","html_url":"https://github.com/dotnet/orleans/issues/1352#issuecomment-251158073","issue_url":"https://api.github.com/repos/dotnet/orleans/issues/1352","id":251158073,"user":{"login":"sergeybykov","id":8248806,"avatar_url":"https://avatars.githubusercontent.com/u/8248806?v=3","gravatar_id":"","url":"https://api.github.com/users/sergeybykov","html_url":"https://github.com/sergeybykov","followers_url":"https://api.github.com/users/sergeybykov/followers","following_url":"https://api.github.com/users/sergeybykov/following{/other_user}","gists_url":"https://api.github.com/users/sergeybykov/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeybykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeybykov/subscriptions","organizations_url":"https://api.github.com/users/sergeybykov/orgs","repos_url":"https://api.github.com/users/sergeybykov/repos","events_url":"https://api.github.com/users/sergeybykov/events{/privacy}","received_events_url":"https://api.github.com/users/sergeybykov/received_events","type":"User","site_admin":false},"created_at":"2016-10-03T16:43:11Z","updated_at":"2016-10-03T16:43:11Z","body":"Where are we currently at with this?"}}
{"actor":{"display_login":"sergeybykov"}}