{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/1589","repository_url":"https://api.github.com/repos/Microsoft/visualfsharp","labels_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/1589/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/1589/comments","events_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/1589/events","html_url":"https://github.com/Microsoft/visualfsharp/pull/1589","id":182131793,"number":1589,"title":"[WIP] Implement ToString on unions (RFC FS-1022)","user":{"login":"colinbull","id":585546,"avatar_url":"https://avatars.githubusercontent.com/u/585546?v=3","gravatar_id":"","url":"https://api.github.com/users/colinbull","html_url":"https://github.com/colinbull","followers_url":"https://api.github.com/users/colinbull/followers","following_url":"https://api.github.com/users/colinbull/following{/other_user}","gists_url":"https://api.github.com/users/colinbull/gists{/gist_id}","starred_url":"https://api.github.com/users/colinbull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinbull/subscriptions","organizations_url":"https://api.github.com/users/colinbull/orgs","repos_url":"https://api.github.com/users/colinbull/repos","events_url":"https://api.github.com/users/colinbull/events{/privacy}","received_events_url":"https://api.github.com/users/colinbull/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/visualfsharp/labels/cla-signed","name":"cla-signed","color":"207de5"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-10-10T22:36:02Z","updated_at":"2016-10-18T20:22:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/1589","html_url":"https://github.com/Microsoft/visualfsharp/pull/1589","diff_url":"https://github.com/Microsoft/visualfsharp/pull/1589.diff","patch_url":"https://github.com/Microsoft/visualfsharp/pull/1589.patch"},"body":"This is an implementation of [RFC FS-1022](https://github.com/fsharp/FSharpLangDesign/blob/master/RFCs/FS-1022-override-ToString-for-discriminated-unions-and-records.md).\r\n\r\nThe current implementation implements by default an override of `ToString` on Unions, only if no override has been defined previously. The implementation is somewhat naive at the minute and just uses `sprintf`. As the RFC states it is possible to create a more optimised implementation of this since do, know the structure of the types within the union case, so we could avoid the reflection cost. However, I'm currently of the opinion that the extra complexity of this might not be worth it. As I would expect this to emit representations that where equivalent to `sprintf` so my gut feeling is that we would just be re-implementing a lot of the reflection logic, just in this case statically using the type definition. Moreover people can simply override `ToString` themselves this if they wish to provide a more performant implementation\r\n\r\nThis is currently work in progress as there are some tests still failing in core04. \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/comments/254627911","html_url":"https://github.com/Microsoft/visualfsharp/pull/1589#issuecomment-254627911","issue_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/1589","id":254627911,"user":{"login":"colinbull","id":585546,"avatar_url":"https://avatars.githubusercontent.com/u/585546?v=3","gravatar_id":"","url":"https://api.github.com/users/colinbull","html_url":"https://github.com/colinbull","followers_url":"https://api.github.com/users/colinbull/followers","following_url":"https://api.github.com/users/colinbull/following{/other_user}","gists_url":"https://api.github.com/users/colinbull/gists{/gist_id}","starred_url":"https://api.github.com/users/colinbull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinbull/subscriptions","organizations_url":"https://api.github.com/users/colinbull/orgs","repos_url":"https://api.github.com/users/colinbull/repos","events_url":"https://api.github.com/users/colinbull/events{/privacy}","received_events_url":"https://api.github.com/users/colinbull/received_events","type":"User","site_admin":false},"created_at":"2016-10-18T20:22:49Z","updated_at":"2016-10-18T20:22:49Z","body":"OK, so the fix to this is quiet simple, just declare the types in the `test.fsi` file. However, I'm not sure why this would change the `CompilationMapping` as @liboz points out and cause the Stack overflow I was seeing. Having checked the language specification, I don't see anything obvious in there that would point to why this behaviour exists. \r\n\r\n@dsyme is this by design or is something else going on here?"}}
{"actor":{"display_login":"colinbull"}}