JarrettBillingsley/Croc — Issue #25: Method calls with non-const method names AND custom context are not codegen'd correctly (if that's even possible?)
Author: JarrettBillingsley
Created: 2011-10-26 11:33:39+00:00
State: open

Something like:

```
a.(foo())(with b)
```

Fails, since `foo()` puts its result in what becomes the 'this' register and the method name returned from it is subsequently overwritten by `b`.

I can't think of any way to solve this other than changing the way method call instructions work (which would also change the native API).

I guess a good question would be: why the hell would you ever want to use a custom context on a method call? Why would you want to look up the method through one object, only to replace the context with another object? It just seems like it's asking for trouble anyway. In the rare cases that you need to call some function that happens to be in a namespace with a custom context, like `foo.bar(with x)`, you could just surround the operand with parens, giving `(foo.bar)(with x)`.