You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Jochen Kemnade (JIRA)" <ji...@apache.org> on 2014/05/26 15:47:01 UTC

[jira] [Closed] (TAP5-2248) ClojureBuilder should support bridging varargs methods

     [ https://issues.apache.org/jira/browse/TAP5-2248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jochen Kemnade closed TAP5-2248.
--------------------------------

    Resolution: Not a Problem

No longer relevant to me

> ClojureBuilder should support bridging varargs methods
> ------------------------------------------------------
>
>                 Key: TAP5-2248
>                 URL: https://issues.apache.org/jira/browse/TAP5-2248
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-clojure
>    Affects Versions: 5.4
>            Reporter: Jochen Kemnade
>
> ClojureBuilder fails to bridge varargs methods to Clojure functions, e.g.
> @FunctionName("clojure.core/+")
> Number plus(Number ... numbers);
> Invoking the method leads to 
> java.lang.ClassCastException: Cannot cast [Ljava.lang.Number; to java.lang.Number
> 	at java.lang.Class.cast(Class.java:3084)
> 	at clojure.core$cast.invoke(core.clj:325)
> 	at clojure.core$_PLUS_.invoke(core.clj:943)
> 	at clojure.lang.Var.invoke(Var.java:415)
> 	at org.apache.tapestry5.clojure.tests.ClojureBuilderSpec.invoke a method with a variable number of arguments(ClojureBuilderSpec.groovy:50)
> We could check java.lang.reflect.Method.isVarArgs() and "unwrap" the last parameter array or some mixture of  clojure.lang.IFn.applyTo(ISeq) and clojure.core/conj for the invocation.



--
This message was sent by Atlassian JIRA
(v6.2#6252)