{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/csharplang/issues/1621","repository_url":"https://api.github.com/repos/dotnet/csharplang","labels_url":"https://api.github.com/repos/dotnet/csharplang/issues/1621/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/csharplang/issues/1621/comments","events_url":"https://api.github.com/repos/dotnet/csharplang/issues/1621/events","html_url":"https://github.com/dotnet/csharplang/issues/1621","id":331130287,"node_id":"MDU6SXNzdWUzMzExMzAyODc=","number":1621,"title":"Unable to provide method level constraints for class level generic parameters.","user":{"login":"SarcoZ","id":30464782,"node_id":"MDQ6VXNlcjMwNDY0Nzgy","avatar_url":"https://avatars1.githubusercontent.com/u/30464782?v=4","gravatar_id":"","url":"https://api.github.com/users/SarcoZ","html_url":"https://github.com/SarcoZ","followers_url":"https://api.github.com/users/SarcoZ/followers","following_url":"https://api.github.com/users/SarcoZ/following{/other_user}","gists_url":"https://api.github.com/users/SarcoZ/gists{/gist_id}","starred_url":"https://api.github.com/users/SarcoZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SarcoZ/subscriptions","organizations_url":"https://api.github.com/users/SarcoZ/orgs","repos_url":"https://api.github.com/users/SarcoZ/repos","events_url":"https://api.github.com/users/SarcoZ/events{/privacy}","received_events_url":"https://api.github.com/users/SarcoZ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-06-11T10:24:08Z","updated_at":"2018-06-11T18:56:21Z","closed_at":null,"author_association":"NONE","body":"some generic interface like this:\r\n\r\npublic interface IPack<TKey>\r\n    {\r\n        /// <summary>\r\n        /// Key\r\n        /// </summary>\r\n        TKey Key { get; }\r\n    }\r\n\r\n    public interface IPack<TKey, THeader, TBody> : IPack<TKey>\r\n    {\r\n        /// <summary>\r\n        /// Header\r\n        /// </summary>\r\n        THeader Header { get; }\r\n\r\n        /// <summary>\r\n        /// Body\r\n        /// </summary>\r\n        TBody Body { get; }\r\n    }\r\n\r\n    /// <summary>\r\n    /// Pack A\r\n    /// </summary>\r\n    public class PackA : IPack<string, string, byte[]>\r\n    {\r\n        /// <summary>\r\n        /// \r\n        /// </summary>\r\n        public string Key { get; private set; }\r\n\r\n        public byte[] Body { get; private set; }\r\n\r\n        public string Header { get; private set; }\r\n    }\r\n\r\n    /// <summary>\r\n    /// Pack builder\r\n    /// </summary>\r\n    /// <typeparam name=\"TPack\"></typeparam>\r\n    public interface IBuilder<TPack> where TPack : IPack<string>\r\n    {\r\n        byte[] BuildPack(TPack pack);\r\n\r\n        /// <summary>\r\n        /// this is not my need,only sample,it can be compile success\r\n        /// </summary>\r\n        /// <typeparam name=\"TSubPack\"></typeparam>\r\n        /// <param name=\"pack\"></param>\r\n        /// <returns></returns>\r\n        byte[] BuildPack<TSubPack>(TPack pack) where TSubPack : TPack;\r\n\r\n        /// <summary>\r\n        /// why this not support? \r\n        /// I think this is very useful,any other I must be define IBuilder<TPack,THeader,TBody> where TPack:IPack<string, THeader, TBody>\r\n        /// which is non convenient when use\r\n        /// </summary>\r\n        /// <typeparam name=\"THeader\"></typeparam>\r\n        /// <typeparam name=\"TBody\"></typeparam>\r\n        /// <param name=\"pack\"></param>\r\n        /// <returns></returns>\r\n        byte[] BuildPack<THeader, TBody>(THeader header, TBody body)\r\n            where TPack : IPack<string, THeader, TBody>;\r\n    }\r\n\r\n\r\nIs this can be support?"},"comment":{"url":"https://api.github.com/repos/dotnet/csharplang/issues/comments/396349030","html_url":"https://github.com/dotnet/csharplang/issues/1621#issuecomment-396349030","issue_url":"https://api.github.com/repos/dotnet/csharplang/issues/1621","id":396349030,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjM0OTAzMA==","user":{"login":"VisualMelon","id":5646475,"node_id":"MDQ6VXNlcjU2NDY0NzU=","avatar_url":"https://avatars2.githubusercontent.com/u/5646475?v=4","gravatar_id":"","url":"https://api.github.com/users/VisualMelon","html_url":"https://github.com/VisualMelon","followers_url":"https://api.github.com/users/VisualMelon/followers","following_url":"https://api.github.com/users/VisualMelon/following{/other_user}","gists_url":"https://api.github.com/users/VisualMelon/gists{/gist_id}","starred_url":"https://api.github.com/users/VisualMelon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VisualMelon/subscriptions","organizations_url":"https://api.github.com/users/VisualMelon/orgs","repos_url":"https://api.github.com/users/VisualMelon/repos","events_url":"https://api.github.com/users/VisualMelon/events{/privacy}","received_events_url":"https://api.github.com/users/VisualMelon/received_events","type":"User","site_admin":false},"created_at":"2018-06-11T18:56:21Z","updated_at":"2018-06-11T18:56:21Z","author_association":"NONE","body":"@bondsbw if the compiler is covering over `T*`, then it probably hide away `T*` at the call-site also by just throwing meta-data at it. However, what frightened me, is that inside the method, it would also need to cast instances of `T` handled by the method to `T*`, and then I think the sugar comes off, because only languages which recognise the C# specific no-clr-change-please-meta-data will guarantee they are calling it with `T* = T`."}}
{"actor":{"display_login":"VisualMelon"}}