Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type definition fails in begin-end block which includes a comprehension #10555

Closed
mauro3 opened this issue Mar 18, 2015 · 2 comments
Closed

Type definition fails in begin-end block which includes a comprehension #10555

mauro3 opened this issue Mar 18, 2015 · 2 comments

Comments

@mauro3
Copy link
Contributor

mauro3 commented Mar 18, 2015

This works:

julia> begin
           type A1
               a
           end
       end

julia> 

this doesn't:

julia> begin
           [i for  i=[1]]
           type A1
               a
           end
       end
ERROR: error compiling anonymous: type definition not allowed inside a local scope

both on 0.3 and 0.4

@JeffBezanson
Copy link
Member

dup of #2586

@mauro3
Copy link
Contributor Author

mauro3 commented Mar 18, 2015

Sorry! Just one more data-point, the suggested workaround in #2586 --putting a let-block around the comprehension-- does not work (anymore?):

julia> begin
           let
               [i for  i=[1]]
           end
           type A1
               a
           end
       end
ERROR: error compiling anonymous: type definition not allowed inside a local scope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants