{"action":"created","issue":{"url":"https://api.github.com/repos/Araq/Nim/issues/2776","labels_url":"https://api.github.com/repos/Araq/Nim/issues/2776/labels{/name}","comments_url":"https://api.github.com/repos/Araq/Nim/issues/2776/comments","events_url":"https://api.github.com/repos/Araq/Nim/issues/2776/events","html_url":"https://github.com/Araq/Nim/issues/2776","id":79572551,"number":2776,"title":"Invalid indentation on implicit result with multiline binary operators","user":{"login":"apense","id":10226339,"avatar_url":"https://avatars.githubusercontent.com/u/10226339?v=3","gravatar_id":"","url":"https://api.github.com/users/apense","html_url":"https://github.com/apense","followers_url":"https://api.github.com/users/apense/followers","following_url":"https://api.github.com/users/apense/following{/other_user}","gists_url":"https://api.github.com/users/apense/gists{/gist_id}","starred_url":"https://api.github.com/users/apense/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apense/subscriptions","organizations_url":"https://api.github.com/users/apense/orgs","repos_url":"https://api.github.com/users/apense/repos","events_url":"https://api.github.com/users/apense/events{/privacy}","received_events_url":"https://api.github.com/users/apense/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-22T19:07:02Z","updated_at":"2015-05-22T19:16:14Z","closed_at":null,"body":"It seems like having an implicit `result` still expects indentation like a normal `result`. Not sure if this is intentional.\r\n\r\nExample\r\n```nim\r\nproc ortest(): int =\r\n  ## fine\r\n  3 or 4 or\r\n    5\r\nproc ortest2(): int =\r\n  ## fails, like ortest3()\r\n  result = 3 or 4 or\r\n  5\r\nproc ortest3(): int =\r\n  ## fails\r\n  3 or 4 or\r\n  5\r\n```\r\n\r\nDoes the same thing with all binary operators I tried (logical and arithmetic) including `+`, etc.\r\n\r\nI likely missed something in the tutorial, *but* it seems like since\r\n```nim\r\nproc test(): bool =\r\n  result = true or\r\n           false ## the true and false are aligned\r\n```\r\nworks, not declaring `result` explicitly should support similar indentation"},"comment":{"url":"https://api.github.com/repos/Araq/Nim/issues/comments/104746844","html_url":"https://github.com/Araq/Nim/issues/2776#issuecomment-104746844","issue_url":"https://api.github.com/repos/Araq/Nim/issues/2776","id":104746844,"user":{"login":"apense","id":10226339,"avatar_url":"https://avatars.githubusercontent.com/u/10226339?v=3","gravatar_id":"","url":"https://api.github.com/users/apense","html_url":"https://github.com/apense","followers_url":"https://api.github.com/users/apense/followers","following_url":"https://api.github.com/users/apense/following{/other_user}","gists_url":"https://api.github.com/users/apense/gists{/gist_id}","starred_url":"https://api.github.com/users/apense/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apense/subscriptions","organizations_url":"https://api.github.com/users/apense/orgs","repos_url":"https://api.github.com/users/apense/repos","events_url":"https://api.github.com/users/apense/events{/privacy}","received_events_url":"https://api.github.com/users/apense/received_events","type":"User","site_admin":false},"created_at":"2015-05-22T19:16:14Z","updated_at":"2015-05-22T19:16:14Z","body":"Oh I understand why the second test fails. It just seemed a little odd when doing multilines without an explicit `result` needs an indent as if you already wrote `result`. I was doing:\r\n\r\n```nim\r\npb(a, bit, 0)         or pb(b, bit, 1)       or pb(c, bit, 2)       or pb(d, bit, 3)       or\r\npb(a, bit +  8, 4)  or pb(b, bit +  8, 5)  or pb(c, bit +  8, 6)  or pb(d, bit +  8, 7)   or\r\npb(a, bit + 16, 8)  or pb(b, bit + 16, 9)  or pb(c, bit + 16, 10) or pb(d, bit + 16, 11)  or\r\npb(a, bit + 24, 12) or pb(b, bit + 24, 13) or pb(c, bit + 24, 14) or pb(d, bit + 24, 15)\r\n```\r\n\r\nfor an AES routine, but now I have\r\n```nim\r\npb(a, bit, 0)         or pb(b, bit, 1)       or pb(c, bit, 2)       or pb(d, bit, 3)       or\r\n      pb(a, bit +  8, 4)  or pb(b, bit +  8, 5)  or pb(c, bit +  8, 6)  or pb(d, bit +  8, 7)   or\r\n      pb(a, bit + 16, 8)  or pb(b, bit + 16, 9)  or pb(c, bit + 16, 10) or pb(d, bit + 16, 11)  or\r\n      pb(a, bit + 24, 12) or pb(b, bit + 24, 13) or pb(c, bit + 24, 14) or pb(d, bit + 24, 15)\r\n```\r\n\r\nwhich just didn't look as nice. It's not a problem really, it's just not obvious unless you write out `result` (which is why I guess it's not recommended to omit it :stuck_out_tongue_closed_eyes: )"}}