{"action":"opened","issue":{"url":"https://api.github.com/repos/WebAssembly/design/issues/707","repository_url":"https://api.github.com/repos/WebAssembly/design","labels_url":"https://api.github.com/repos/WebAssembly/design/issues/707/labels{/name}","comments_url":"https://api.github.com/repos/WebAssembly/design/issues/707/comments","events_url":"https://api.github.com/repos/WebAssembly/design/issues/707/events","html_url":"https://github.com/WebAssembly/design/issues/707","id":159698732,"number":707,"title":"Type checking and unreachable blocks","user":{"login":"MikeHolman","id":4925255,"avatar_url":"https://avatars.githubusercontent.com/u/4925255?v=3","gravatar_id":"","url":"https://api.github.com/users/MikeHolman","html_url":"https://github.com/MikeHolman","followers_url":"https://api.github.com/users/MikeHolman/followers","following_url":"https://api.github.com/users/MikeHolman/following{/other_user}","gists_url":"https://api.github.com/users/MikeHolman/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeHolman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeHolman/subscriptions","organizations_url":"https://api.github.com/users/MikeHolman/orgs","repos_url":"https://api.github.com/users/MikeHolman/repos","events_url":"https://api.github.com/users/MikeHolman/events{/privacy}","received_events_url":"https://api.github.com/users/MikeHolman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-10T18:51:39Z","updated_at":"2016-06-10T18:51:39Z","closed_at":null,"body":"Feels like there are some corner cases with type checking, and AFAIK there hasn't really been much discussion on it. Right now I am looking at cases like the following pseudo-code for a function which has been defined with an int result type:\r\n````\r\n(func\r\n  (if condition\r\n    (ret (const 1))\r\n  else\r\n    (ret (const 2))\r\n  )\r\n)\r\n````\r\n\r\nShould this validate? All paths return an int but the if/else doesn't yield a value.\r\n\r\nIf that should validate, what about this?\r\n\r\n````\r\n(func\r\n  (if condition\r\n    (ret (const 1))\r\n    (const 1.5)\r\n  else\r\n    (ret (const 2))\r\n    (const 1.5)\r\n  )\r\n)\r\n````\r\n\r\nSame type of scenario, but now it's arguable whether we consider that the if/else yields float or doesn't yield. If it yields, then I suppose we fail validation, because that (unreachable) path yields a float.\r\n\r\nHow are you guys handling this type of scenario today?"}}
{"actor":{"display_login":"MikeHolman"}}