{"action":"created","issue":{"url":"https://api.github.com/repos/manastech/crystal/issues/1558","labels_url":"https://api.github.com/repos/manastech/crystal/issues/1558/labels{/name}","comments_url":"https://api.github.com/repos/manastech/crystal/issues/1558/comments","events_url":"https://api.github.com/repos/manastech/crystal/issues/1558/events","html_url":"https://github.com/manastech/crystal/issues/1558","id":107726947,"number":1558,"title":"Incorrect line numbers in compile error trace","user":{"login":"trapped","id":4138706,"avatar_url":"https://avatars.githubusercontent.com/u/4138706?v=3","gravatar_id":"","url":"https://api.github.com/users/trapped","html_url":"https://github.com/trapped","followers_url":"https://api.github.com/users/trapped/followers","following_url":"https://api.github.com/users/trapped/following{/other_user}","gists_url":"https://api.github.com/users/trapped/gists{/gist_id}","starred_url":"https://api.github.com/users/trapped/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trapped/subscriptions","organizations_url":"https://api.github.com/users/trapped/orgs","repos_url":"https://api.github.com/users/trapped/repos","events_url":"https://api.github.com/users/trapped/events{/privacy}","received_events_url":"https://api.github.com/users/trapped/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/manastech/crystal/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/manastech/crystal/labels/compiler","name":"compiler","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-22T14:34:16Z","updated_at":"2015-09-22T20:26:09Z","closed_at":"2015-09-22T18:33:07Z","body":"The compiler reports incorrect line numbers and text when code (probably containing macros) fails to compile.\r\nFor example [this line](https://github.com/trapped/fs_adapter/blob/ff1cada95bd25b0ac6e60b37953122340af88368/src/fs_adapter/driver.cr#L144) using Crystal at 5e53fb1 prints:\r\n```\r\nin ./src/fs_adapter/driver.cr:164: undefined method 'table_path' (if you declared 'table_path' in a suffix if, declare it in a regular if for this to work)\r\n\r\n      tables_.not_nil!.map(&.[2])\r\n                        ^~~~~~~~~~\r\n```\r\nI believe it's due to the line references being collected before expanding macros, but take my word with a grain of salt as I don't know almost anything about the compiler's internals."},"comment":{"url":"https://api.github.com/repos/manastech/crystal/issues/comments/142409444","html_url":"https://github.com/manastech/crystal/issues/1558#issuecomment-142409444","issue_url":"https://api.github.com/repos/manastech/crystal/issues/1558","id":142409444,"user":{"login":"trapped","id":4138706,"avatar_url":"https://avatars.githubusercontent.com/u/4138706?v=3","gravatar_id":"","url":"https://api.github.com/users/trapped","html_url":"https://github.com/trapped","followers_url":"https://api.github.com/users/trapped/followers","following_url":"https://api.github.com/users/trapped/following{/other_user}","gists_url":"https://api.github.com/users/trapped/gists{/gist_id}","starred_url":"https://api.github.com/users/trapped/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trapped/subscriptions","organizations_url":"https://api.github.com/users/trapped/orgs","repos_url":"https://api.github.com/users/trapped/repos","events_url":"https://api.github.com/users/trapped/events{/privacy}","received_events_url":"https://api.github.com/users/trapped/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T20:26:09Z","updated_at":"2015-09-22T20:26:09Z","body":"I do too develop through Windows (actually, using a buggy sshfs driver) occasionally, but it's actually because I have git configured to convert to CRLF line endings."}}