tarcieri / reia

Ruby-like hybrid OOP/functional programming language for BEAM, the Erlang VM
http://reia-lang.org
MIT License
775 stars 36 forks source link

unbound function can be called but fails #3

Closed pirj closed 14 years ago

pirj commented 15 years ago

class A .. def c .. 1 .. end .. end x=A.c => # x() exception error: undefined function 'A':c/2 in function erl_eval:do_apply/5 in call from eval_shim:exprs/2 in call from reia_erl:erl_funcall/3 in call from 'Eval':exprs/2

tarcieri commented 15 years ago

Well, the bug here is that it shouldn't let you call A.c

If you create an instance of A, e.g. a = A(), and do x = a.c; x() then things work as expected.

It should throw an exception if you try to obtain a reference to a nonexistent function/method.