{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/csharplang/issues/234","repository_url":"https://api.github.com/repos/dotnet/csharplang","labels_url":"https://api.github.com/repos/dotnet/csharplang/issues/234/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/csharplang/issues/234/comments","events_url":"https://api.github.com/repos/dotnet/csharplang/issues/234/events","html_url":"https://github.com/dotnet/csharplang/issues/234","id":212714164,"node_id":"MDU6SXNzdWUyMTI3MTQxNjQ=","number":234,"title":"Proposal: Allow auto implementing delegated interface","user":{"login":"glatzert","id":10154376,"node_id":"MDQ6VXNlcjEwMTU0Mzc2","avatar_url":"https://avatars1.githubusercontent.com/u/10154376?v=4","gravatar_id":"","url":"https://api.github.com/users/glatzert","html_url":"https://github.com/glatzert","followers_url":"https://api.github.com/users/glatzert/followers","following_url":"https://api.github.com/users/glatzert/following{/other_user}","gists_url":"https://api.github.com/users/glatzert/gists{/gist_id}","starred_url":"https://api.github.com/users/glatzert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glatzert/subscriptions","organizations_url":"https://api.github.com/users/glatzert/orgs","repos_url":"https://api.github.com/users/glatzert/repos","events_url":"https://api.github.com/users/glatzert/events{/privacy}","received_events_url":"https://api.github.com/users/glatzert/received_events","type":"User","site_admin":false},"labels":[{"id":537024200,"node_id":"MDU6TGFiZWw1MzcwMjQyMDA=","url":"https://api.github.com/repos/dotnet/csharplang/labels/Discussion","name":"Discussion","color":"c2e0c6","default":false},{"id":545773793,"node_id":"MDU6TGFiZWw1NDU3NzM3OTM=","url":"https://api.github.com/repos/dotnet/csharplang/labels/Feature%20Request","name":"Feature Request","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-03-08T11:55:21Z","updated_at":"2018-11-23T15:31:32Z","closed_at":null,"author_association":"NONE","body":"We encounter the situation that we have to delegate the implementation of interfaces to an private instance of an object implementing the interface:\r\n\r\n```\r\ninterface IInterface {\r\n  void myFunc();\r\n  int myOtherFunc();\r\n  //.. my other umpteen methods\r\n}\r\nclass MyClass : IInterface {\r\n  private IInterface myInterface;\r\n\r\n  public void myFunc() => myInterface.myFunc();\r\n  public int myOtherFunc() { return 42; };\r\n\r\n  // more forwards\r\n}\r\n```\r\n\r\nIt would be nice to write a shorthand definition like this:\r\n```\r\nclass MyFancyClass : IInterface {\r\n  private **(implicit|explicit)** IInterface myInterface; //define if the interface should be implicitly or explicitly implemented.\r\n\r\n  public int myOtherFunc() {\r\n    //it's important to \"overwrite\" this single interface member\r\n    return 42;\r\n  }\r\n}\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/csharplang/issues/comments/441269028","html_url":"https://github.com/dotnet/csharplang/issues/234#issuecomment-441269028","issue_url":"https://api.github.com/repos/dotnet/csharplang/issues/234","id":441269028,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTI2OTAyOA==","user":{"login":"yringler","id":4070825,"node_id":"MDQ6VXNlcjQwNzA4MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/4070825?v=4","gravatar_id":"","url":"https://api.github.com/users/yringler","html_url":"https://github.com/yringler","followers_url":"https://api.github.com/users/yringler/followers","following_url":"https://api.github.com/users/yringler/following{/other_user}","gists_url":"https://api.github.com/users/yringler/gists{/gist_id}","starred_url":"https://api.github.com/users/yringler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yringler/subscriptions","organizations_url":"https://api.github.com/users/yringler/orgs","repos_url":"https://api.github.com/users/yringler/repos","events_url":"https://api.github.com/users/yringler/events{/privacy}","received_events_url":"https://api.github.com/users/yringler/received_events","type":"User","site_admin":false},"created_at":"2018-11-23T15:31:32Z","updated_at":"2018-11-23T15:31:32Z","author_association":"NONE","body":"I was also going to make such a proposal, but then saw that #2017 had the syntax I had in mind.\r\n\r\nIt seems there are a lot of people waking up in the morning and saying \"Gosh, I sure wish I could auto-implement interfaces\", and going ahead to make (or almost make) yet another proposal for the same feature.\r\n\r\nPerhaps that would imply that this is a useful and much desired feature?\r\nEspecially considering that it's just \"syntactic sugar\", I think it is reasonable to consider this sooner, rather than later when #107 is maybe eventually released (I saw that issue referrecened as solving this feature request in one of the billion and 2 requests for this feature, can't remember which)."}}
{"actor":{"display_login":"yringler"}}