{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/14233","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/14233/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/14233/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/14233/events","html_url":"https://github.com/dotnet/roslyn/issues/14233","id":180452156,"number":14233,"title":"Auto mapping override ref property to field","user":{"login":"Thaina","id":1042507,"avatar_url":"https://avatars.githubusercontent.com/u/1042507?v=3","gravatar_id":"","url":"https://api.github.com/users/Thaina","html_url":"https://github.com/Thaina","followers_url":"https://api.github.com/users/Thaina/followers","following_url":"https://api.github.com/users/Thaina/following{/other_user}","gists_url":"https://api.github.com/users/Thaina/gists{/gist_id}","starred_url":"https://api.github.com/users/Thaina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thaina/subscriptions","organizations_url":"https://api.github.com/users/Thaina/orgs","repos_url":"https://api.github.com/users/Thaina/repos","events_url":"https://api.github.com/users/Thaina/events{/privacy}","received_events_url":"https://api.github.com/users/Thaina/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-01T11:32:52Z","updated_at":"2016-10-01T12:41:27Z","closed_at":null,"body":"Since we have ref return feature. We now could use ref return property as abstract, virtual, or interface\r\n\r\nSo I think we could map those ref return property to field directly\r\n\r\n```C#\r\ninterface IVec3\r\n{\r\n    ref float X { get; set; }\r\n    ref float Y { get; set; }\r\n    ref float Z { get; set; }\r\n}\r\n\r\nstruct Vec3 : IVec3\r\n{\r\n    public float X,Y,Z;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/250910451","html_url":"https://github.com/dotnet/roslyn/issues/14233#issuecomment-250910451","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/14233","id":250910451,"user":{"login":"HaloFour","id":10102290,"avatar_url":"https://avatars.githubusercontent.com/u/10102290?v=3","gravatar_id":"","url":"https://api.github.com/users/HaloFour","html_url":"https://github.com/HaloFour","followers_url":"https://api.github.com/users/HaloFour/followers","following_url":"https://api.github.com/users/HaloFour/following{/other_user}","gists_url":"https://api.github.com/users/HaloFour/gists{/gist_id}","starred_url":"https://api.github.com/users/HaloFour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaloFour/subscriptions","organizations_url":"https://api.github.com/users/HaloFour/orgs","repos_url":"https://api.github.com/users/HaloFour/repos","events_url":"https://api.github.com/users/HaloFour/events{/privacy}","received_events_url":"https://api.github.com/users/HaloFour/received_events","type":"User","site_admin":false},"created_at":"2016-10-01T12:41:27Z","updated_at":"2016-10-01T12:41:27Z","body":"How exactly would this be implemented?  The CLR requires that the virtual members of an interface be overridden by compatible members on the implementing class.  The class would still be required to have the property accessors.  At best the compiler could explicitly auto-generate them:\r\n\r\n```cs\r\nstruct Vec3 : IVec3 {\r\n    public float X,Y,Z;\r\n\r\n    ref float IVec.X {\r\n        get { return this.X; }\r\n        set { this.X = value; }\r\n    }\r\n\r\n    ref float IVec.Y {\r\n        get { return this.Y; }\r\n        set { this.Y = value; }\r\n    }\r\n\r\n    ref float IVec.Z {\r\n        get { return this.Z; }\r\n        set { this.Z = value; }\r\n    }\r\n}\r\n```\r\n\r\nBut given that the auto-property implementation is not much more verbose does this really buy any advantages?"}}
{"actor":{"display_login":"HaloFour"}}