payload: {"action":"created","issue":{"url":"https://api.github.com/repos/microsoft/visualfsharp/issues/6712","repository_url":"https://api.github.com/repos/microsoft/visualfsharp","labels_url":"https://api.github.com/repos/microsoft/visualfsharp/issues/6712/labels{/name}","comments_url":"https://api.github.com/repos/microsoft/visualfsharp/issues/6712/comments","events_url":"https://api.github.com/repos/microsoft/visualfsharp/issues/6712/events","html_url":"https://github.com/microsoft/visualfsharp/issues/6712","id":443028590,"node_id":"MDU6SXNzdWU0NDMwMjg1OTA=","number":6712,"title":"Match statement with a patterns referring to an out of scope identifier give incomplete warning","user":{"login":"jbeeko","id":4968704,"node_id":"MDQ6VXNlcjQ5Njg3MDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/4968704?v=4","gravatar_id":"","url":"https://api.github.com/users/jbeeko","html_url":"https://github.com/jbeeko","followers_url":"https://api.github.com/users/jbeeko/followers","following_url":"https://api.github.com/users/jbeeko/following{/other_user}","gists_url":"https://api.github.com/users/jbeeko/gists{/gist_id}","starred_url":"https://api.github.com/users/jbeeko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbeeko/subscriptions","organizations_url":"https://api.github.com/users/jbeeko/orgs","repos_url":"https://api.github.com/users/jbeeko/repos","events_url":"https://api.github.com/users/jbeeko/events{/privacy}","received_events_url":"https://api.github.com/users/jbeeko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-05-11T19:28:58Z","updated_at":"2019-05-11T20:23:18Z","closed_at":null,"author_association":"NONE","body":"Related #5475.\r\n\r\n## What\r\n\r\nThe following code compiles with warnings which could be improved upon.\r\n\r\n```\r\nmodule DUs =\r\n    type Countries = \r\n    | CA\r\n    | US\r\nlet x = DUs.CA\r\n\r\nlet output = \r\n    match x with \r\n    | US -> \"US\"\r\n    | CA -> \"CA\"\r\n    | _ -> \"XX\"\r\noutput\r\n```\r\n\r\nThere is a warning on `| US -> \"US\"` that the value `US` is unused. \r\n<img width=\"327\" alt=\"image\" src=\"https://user-images.githubusercontent.com/4968704/57574078-22344000-73e7-11e9-9458-45a4878f03c8.png\">\r\n\r\n\r\nThe default pattern has a warning that the rule will never be matched. \r\n<img width=\"385\" alt=\"image\" src=\"https://user-images.githubusercontent.com/4968704/57574081-2eb89880-73e7-11e9-9540-374ac0f1c8ad.png\">\r\n\r\n## Why\r\n\r\nIf when seeing the warnings you not taking into account that the pattern can be a value or a binding this is confusing in two ways. \r\n1. In the above example is is obvious that `US`  is out of scope. But in larger files this may not be obvious. Moreover normally referencing `US` without opening `DUs` would result in \"The value or constructor US is not defined...\" The message that it will never be used does not really point in the right direction.\r\n2. The warning that the default pattern will never be matched is also confusing. Why not, should they not always match. And if the `CA` is never used why does the default not match?\r\n\r\nAnd when this code is run it results in \"US\" which can also be confusing. \r\n\r\nFinally because there are only warnings this could result in a bug. \r\n\r\n\r\n\r\n## How\r\n\r\nThe compiler is assuming that `| CA` is a binding of x to CA not used on the right and emits a message to explain that situation. It should also suggest that CA might be an undefined value.  Something like\r\n\r\n\"Binding `CA` is not used in this rule or `CA` refers to a  value not defined...\"\r\n "},"comment":{"url":"https://api.github.com/repos/microsoft/visualfsharp/issues/comments/491541148","html_url":"https://github.com/microsoft/visualfsharp/issues/6712#issuecomment-491541148","issue_url":"https://api.github.com/repos/microsoft/visualfsharp/issues/6712","id":491541148,"node_id":"MDEyOklzc3VlQ29tbWVudDQ5MTU0MTE0OA==","user":{"login":"jbeeko","id":4968704,"node_id":"MDQ6VXNlcjQ5Njg3MDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/4968704?v=4","gravatar_id":"","url":"https://api.github.com/users/jbeeko","html_url":"https://github.com/jbeeko","followers_url":"https://api.github.com/users/jbeeko/followers","following_url":"https://api.github.com/users/jbeeko/following{/other_user}","gists_url":"https://api.github.com/users/jbeeko/gists{/gist_id}","starred_url":"https://api.github.com/users/jbeeko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbeeko/subscriptions","organizations_url":"https://api.github.com/users/jbeeko/orgs","repos_url":"https://api.github.com/users/jbeeko/repos","events_url":"https://api.github.com/users/jbeeko/events{/privacy}","received_events_url":"https://api.github.com/users/jbeeko/received_events","type":"User","site_admin":false},"created_at":"2019-05-11T20:23:18Z","updated_at":"2019-05-11T20:23:18Z","author_association":"NONE","body":"Whoops, I just noticed that when editing completed the match so my point about the default pattern having a warning is bit confusing. You actually get this warning even if the match is not complete. I edit the sample code to make this clear.\r\n"}}
other: {"actor":{"display_login":"jbeeko"}}