Methods cannot be invoked from within list comprehensions
Reported by Philipp Pirozhkov | February 28th, 2009 @ 07:55 AM
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
Comments and changes to this ticket
-
Philipp Pirozhkov February 28th, 2009 @ 07:56 AM
works fine
class A def bar(x) x.map{|z| foo(z)} def foo(y) y @@
-
Tony Arcieri February 28th, 2009 @ 11:40 AM
- 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.
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Reia a dynamic scripting language for the Erlang virtual machine (BEAM)