Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Methods cannot be invoked from within list comprehensions

#23

works fine:


class A
  def bar(x)
    foo(x)

  def foo(y)
    y

fails to load:


class A
  def bar(x)
    [foo(z) | z in x]

  def foo(y)
    y

>> load('issue.re')
.:2: variable '___instance_variables_1' is unbound
exception throw: {error,[{".",
                          [{2,erl_lint,
                            {unbound_var,'___instance_variables_1'}}]}],
                        []}
  in function  reia_module:build/2
  in call from erl_eval:do_apply/5
  in call from eval_shim:exprs/3
  in call from reia_erl:erl_funcall/3
  in call from 'Eval':exprs/2
  in call from 'Eval':string/1
  in call from 'Main':load/1
  in call from 'Eval':local/2

Reported by Philipp Pirozhkov · February 28th, 2009 @ 07:55 AM

State: new
Milestone: none
Assigned to: Tony Arcieri Tony Arcieri

Activity

  1. Philipp Pirozhkov
    Philipp Pirozhkov

    works fine

    
    class A
      def bar(x)
        x.map{|z| foo(z)}
    
      def foo(y)
        y
    @@
    

    February 28th, 2009 @ 07:56 AM

  2. Tony Arcieri
    Tony Arcieri
    • Title changed from inline call to a class method fails to compile to Methods cannot be invoked from within list comprehensions

    Ugh, another scope where issues occur accessing hidden ivar state.

    Not sure of a good solution to this one either.

    February 28th, 2009 @ 11:40 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.