Skip to content

eval'd expressions inside begin..end should be top-level when possible #2586

@mlubin

Description

@mlubin

Looks like a bug in eval:

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" to list help topics
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.2.0-514.r3d43
 _/ |\__'_|_|_|\__'_|  |  Commit 3d43df9032 2013-03-16 06:59:07
|__/                   |

julia> @eval begin
           type T 
               x 
           end
           T(sum([1,2]))
       end
T(3)

julia> @eval begin
           type T2 
               x 
           end
           s = 0
           for i in [1,2]
               s += i
           end
           T2(s)
       end
ERROR: error compiling anonymous: unsupported or misplaced expression composite_type in function anonymous

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions