{"action":"created","issue":{"url":"https://api.github.com/repos/ink-lang/ink/issues/98","labels_url":"https://api.github.com/repos/ink-lang/ink/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/ink-lang/ink/issues/98/comments","events_url":"https://api.github.com/repos/ink-lang/ink/issues/98/events","html_url":"https://github.com/ink-lang/ink/issues/98","id":55148644,"number":98,"title":"Functions with multiple return types","user":{"login":"CaptainChloride","id":7758442,"avatar_url":"https://avatars.githubusercontent.com/u/7758442?v=3","gravatar_id":"","url":"https://api.github.com/users/CaptainChloride","html_url":"https://github.com/CaptainChloride","followers_url":"https://api.github.com/users/CaptainChloride/followers","following_url":"https://api.github.com/users/CaptainChloride/following{/other_user}","gists_url":"https://api.github.com/users/CaptainChloride/gists{/gist_id}","starred_url":"https://api.github.com/users/CaptainChloride/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaptainChloride/subscriptions","organizations_url":"https://api.github.com/users/CaptainChloride/orgs","repos_url":"https://api.github.com/users/CaptainChloride/repos","events_url":"https://api.github.com/users/CaptainChloride/events{/privacy}","received_events_url":"https://api.github.com/users/CaptainChloride/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ink-lang/ink/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/ink-lang/ink/labels/proposal","name":"proposal","color":"adbeef"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-22T12:41:42Z","updated_at":"2015-01-22T13:42:15Z","closed_at":null,"body":"I think this would be an interesting idea. The example should eliminate most of the ambiguity (if any):\r\n\r\n```rust\r\nfn main() {\r\n    str name\r\n    println(\"Please enter your name:\")\r\n    get(name)\r\n    some_func(name)\r\n}\r\n\r\nfn some_func(str name): void | str {\r\n    if(name == \"Felix\" or name == \"felix\") -> println(\"Huge ass\")\r\n    else println(\"Good lad!\")\r\n}\r\n```\r\n\r\nSo the above example would mean that it returns `void`, and everything is good.\r\n\r\n```rust\r\nfn main() {\r\n    str name\r\n    println(\"Please enter your name:\")\r\n    get(name)\r\n    str val = some_func(name)\r\n    println(val)\r\n}\r\n\r\nfn some_func(str name): void | str {\r\n    if(name == \"Felix\" or name == \"felix\") -> return \"Huge ass\"\r\n    else return \"Good lad!\"\r\n}\r\n```\r\nSo here it returns a value, which is accepted into the `val` variable and printed. Not exactly the most accurate example, but it should give you an idea as to what I'm getting at. Tell me your thoughts @ink-lang/owners @ink-lang/super-contributors "},"comment":{"url":"https://api.github.com/repos/ink-lang/ink/issues/comments/71021372","html_url":"https://github.com/ink-lang/ink/issues/98#issuecomment-71021372","issue_url":"https://api.github.com/repos/ink-lang/ink/issues/98","id":71021372,"user":{"login":"ianhedoesit","id":7721597,"avatar_url":"https://avatars.githubusercontent.com/u/7721597?v=3","gravatar_id":"","url":"https://api.github.com/users/ianhedoesit","html_url":"https://github.com/ianhedoesit","followers_url":"https://api.github.com/users/ianhedoesit/followers","following_url":"https://api.github.com/users/ianhedoesit/following{/other_user}","gists_url":"https://api.github.com/users/ianhedoesit/gists{/gist_id}","starred_url":"https://api.github.com/users/ianhedoesit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianhedoesit/subscriptions","organizations_url":"https://api.github.com/users/ianhedoesit/orgs","repos_url":"https://api.github.com/users/ianhedoesit/repos","events_url":"https://api.github.com/users/ianhedoesit/events{/privacy}","received_events_url":"https://api.github.com/users/ianhedoesit/received_events","type":"User","site_admin":false},"created_at":"2015-01-22T13:42:15Z","updated_at":"2015-01-22T13:42:15Z","body":"I don't know. This current proposal would be obsolete with option types."}}