{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/5042","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/5042/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/5042/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/5042/events","html_url":"https://github.com/dotnet/roslyn/issues/5042","id":105070127,"number":5042,"title":"[Discuss] break inside of a match expression","user":{"login":"AdamSpeight2008","id":900107,"avatar_url":"https://avatars.githubusercontent.com/u/900107?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamSpeight2008","html_url":"https://github.com/AdamSpeight2008","followers_url":"https://api.github.com/users/AdamSpeight2008/followers","following_url":"https://api.github.com/users/AdamSpeight2008/following{/other_user}","gists_url":"https://api.github.com/users/AdamSpeight2008/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamSpeight2008/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamSpeight2008/subscriptions","organizations_url":"https://api.github.com/users/AdamSpeight2008/orgs","repos_url":"https://api.github.com/users/AdamSpeight2008/repos","events_url":"https://api.github.com/users/AdamSpeight2008/events{/privacy}","received_events_url":"https://api.github.com/users/AdamSpeight2008/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Language%20Design","name":"Area-Language Design","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Discussion","name":"Discussion","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/2","html_url":"https://github.com/dotnet/roslyn/milestones/Unknown","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/2/labels","id":937398,"number":2,"title":"Unknown","description":"This represents work which is not planned for a specific release.\r\n\r\n<!---\r\n@huboard:{\"order\":0.25}\n-->\r\n","creator":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"open_issues":327,"closed_issues":73,"state":"open","created_at":"2015-01-15T20:46:02Z","updated_at":"2015-09-06T05:03:27Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-09-06T04:17:09Z","updated_at":"2015-09-06T06:01:46Z","closed_at":null,"body":"`break` inside of a `switch` block exits that block.\r\nSince the predominant style is lambda-style expressions, and `break` doesn't quite make sense.\r\n\r\nWhat should `break` do inside of a `match`?\r\n 1. exit the match.   (just like  `switch`)\r\n 2. exit the enclosing block (not the `match` )\r\n 3. Add `exit ...` & `continue ..` syntax of VB?\r\neg\r\n```c#\r\nselect case ( ... )\r\n{\r\n  case ... : \r\n    while ( ... )\r\n    {\r\n      foo = match ( ... )\r\n            {\r\n              |: ... => exit while; // Executes code from point after the enclosing while block.\r\n              |: ... => exit select; // Executes code from point after the enclosing select block.\r\n              |: ... => continue while; // Execution continues at the enclosing while.\r\n              |: ... => continue select; // Execution continues at the enclosing select.\r\n              |: => null;\r\n            }\r\n    }\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/138043951","html_url":"https://github.com/dotnet/roslyn/issues/5042#issuecomment-138043951","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/5042","id":138043951,"user":{"login":"AdamSpeight2008","id":900107,"avatar_url":"https://avatars.githubusercontent.com/u/900107?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamSpeight2008","html_url":"https://github.com/AdamSpeight2008","followers_url":"https://api.github.com/users/AdamSpeight2008/followers","following_url":"https://api.github.com/users/AdamSpeight2008/following{/other_user}","gists_url":"https://api.github.com/users/AdamSpeight2008/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamSpeight2008/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamSpeight2008/subscriptions","organizations_url":"https://api.github.com/users/AdamSpeight2008/orgs","repos_url":"https://api.github.com/users/AdamSpeight2008/repos","events_url":"https://api.github.com/users/AdamSpeight2008/events{/privacy}","received_events_url":"https://api.github.com/users/AdamSpeight2008/received_events","type":"User","site_admin":false},"created_at":"2015-09-06T06:01:45Z","updated_at":"2015-09-06T06:01:45Z","body":"@gafter Does it matter, which proposal? It's not a specify `match expression` proposal but a discussion of the meaning of `break` with them.\r\n* Yours proposes it maintaining `switch` semantics. \r\n* Mine and @HaloFour it `break`'s surrounding scope and not `match`'s scope\r\n* I suggest introducing `exit ...` and `continue ...` into c#\r\n* Use lambda expression's meaning\r\n```c#\r\n( ... ) => break;\r\n```"}}