Laythe-lang/Laythe

Calling Methods in HOF doesn't work correctly

Closed this issue · 1 comments

Currently the follow script will report an incorrect runtime error

class A {
  foo(x) { x / 2 }
}

let iter = [1, 2, 3, 4].iter().map(A().foo);

assertEq(iter.next(), true);
// RuntimeError: Iter is not callable.

The stack for the script is getting incorrectly setup.