{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/28775","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/28775/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/28775/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/28775/events","html_url":"https://github.com/JuliaLang/julia/issues/28775","id":351976327,"node_id":"MDU6SXNzdWUzNTE5NzYzMjc=","number":28775,"title":"Using `@sync` from a package macro fails when the same result works in the REPL","user":{"login":"ChrisRackauckas","id":1814174,"node_id":"MDQ6VXNlcjE4MTQxNzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1814174?v=4","gravatar_id":"","url":"https://api.github.com/users/ChrisRackauckas","html_url":"https://github.com/ChrisRackauckas","followers_url":"https://api.github.com/users/ChrisRackauckas/followers","following_url":"https://api.github.com/users/ChrisRackauckas/following{/other_user}","gists_url":"https://api.github.com/users/ChrisRackauckas/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisRackauckas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisRackauckas/subscriptions","organizations_url":"https://api.github.com/users/ChrisRackauckas/orgs","repos_url":"https://api.github.com/users/ChrisRackauckas/repos","events_url":"https://api.github.com/users/ChrisRackauckas/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisRackauckas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-20T03:55:25Z","updated_at":"2018-08-20T12:56:33Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Maybe this is simpler than I think, but https://github.com/ChrisRackauckas/ParallelDataTransfer.jl/issues/14 seems to demonstrate that using `@sync` from outside the `Main` module gives an issue with `let`. MWE:\r\n\r\n```julia\r\nmodule Tester\r\n  macro tester()\r\n    quote\r\n      @sync for i in 1:5\r\n        println(i)\r\n      end\r\n    end\r\n  end\r\nend\r\nusing Main.Tester\r\nTester.@tester\r\n```\r\n\r\nthrows\r\n\r\n```julia\r\nsyntax: invalid let syntax\r\ninclude_string(::Module, ::String, ::String) at loading.jl:1002\r\ninclude_string(::Module, ::String, ::String, ::Int64) at eval.jl:30\r\n(::getfield(Atom, Symbol(\"##110#115\")){String,Int64,String})() at eval.jl:89\r\nwithpath(::getfield(Atom, Symbol(\"##110#115\")){String,Int64,String}, ::String) at utils.jl:30\r\nwithpath at eval.jl:46 [inlined]\r\n#109 at eval.jl:88 [inlined]\r\nhideprompt(::getfield(Atom, Symbol(\"##109#114\")){String,Int64,String}) at repl.jl:76\r\nmacro expansion at eval.jl:87 [inlined]\r\n(::getfield(Atom, Symbol(\"##108#113\")){Dict{String,Any}})() at task.jl:85\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/414306911","html_url":"https://github.com/JuliaLang/julia/issues/28775#issuecomment-414306911","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/28775","id":414306911,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDMwNjkxMQ==","user":{"login":"KristofferC","id":1282691,"node_id":"MDQ6VXNlcjEyODI2OTE=","avatar_url":"https://avatars1.githubusercontent.com/u/1282691?v=4","gravatar_id":"","url":"https://api.github.com/users/KristofferC","html_url":"https://github.com/KristofferC","followers_url":"https://api.github.com/users/KristofferC/followers","following_url":"https://api.github.com/users/KristofferC/following{/other_user}","gists_url":"https://api.github.com/users/KristofferC/gists{/gist_id}","starred_url":"https://api.github.com/users/KristofferC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KristofferC/subscriptions","organizations_url":"https://api.github.com/users/KristofferC/orgs","repos_url":"https://api.github.com/users/KristofferC/repos","events_url":"https://api.github.com/users/KristofferC/events{/privacy}","received_events_url":"https://api.github.com/users/KristofferC/received_events","type":"User","site_admin":false},"created_at":"2018-08-20T12:56:33Z","updated_at":"2018-08-20T12:56:33Z","author_association":"CONTRIBUTOR","body":"Hygiene for macros inside macros feels impossible to do correctly now. Ref https://github.com/JuliaLang/julia/pull/22985"}}
{"actor":{"display_login":"KristofferC"}}