golo-lang/golo-lang — pull request #228 by MakeNowJust (2014-12-28 14:15:39+00:00)
Title: Fix ClosureCallSupport to consider types besides Object

See #226 , this pull request solves it too.

`ClosureCallSupport` considers Object type only, so such code can't work before.

`code`

```golo
module Main
import java.lang.invoke.MethodType

function main = |args| {
let f = |a, b| {
return a + b
}
println(f: asType(methodType(Integer.type, Integer.type, Integer.type)) (1, 2))
}
```

`result`

```
Exception in thread "main" java.lang.IllegalArgumentException: target and fallback types must match: (MethodHandle,Integer,Integer)Integer != (MethodHandle,Object,Object)Object
at java.lang.invoke.MethodHandleStatics.newIllegalArgumentException(MethodHandleStatics.java:109)
at java.lang.invoke.MethodHandles.misMatchedTypes(MethodHandles.java:2775)
at java.lang.invoke.MethodHandles.guardWithTest(MethodHandles.java:2759)
at fr.insalyon.citi.golo.runtime.ClosureCallSupport.fallback(ClosureCallSupport.java:98)
at Main.main(ex.golo:9)
at fr.insalyon.citi.golo.cli.Main.callRun(Main.java:455)
at fr.insalyon.citi.golo.cli.Main.golo(Main.java:494)
at fr.insalyon.citi.golo.cli.Main.main(Main.java:215)
```

So I fix to consider types besides Object, and add tests for it.