[ 
https://issues.apache.org/jira/browse/GROOVY-9114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16840081#comment-16840081
 ] 

Ernestas edited comment on GROOVY-9114 at 5/15/19 6:18 AM:
-----------------------------------------------------------

[~blackdrag] 

I think
{noformat}
boolean java.lang.reflect.Method.isSynthetic() {noformat}
should be used for this.


was (Author: ernestas):
[~blackdrag] 

I think `boolean java.lang.reflect.Method.isSynthetic()` should be used for 
this.

> Groovy chooses inline reified method over standard from Kotlin class 
> ---------------------------------------------------------------------
>
>                 Key: GROOVY-9114
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9114
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime
>    Affects Versions: 2.5.x
>            Reporter: Ernestas
>            Priority: Major
>
> Given kotlin class with two methods:
> {code:java}
> fun pathParam(key: String): String = 
> ContextUtil.pathParamOrThrow(pathParamMap, key, matchedPath)
>       
> /** Reified version of [pathParam] (Kotlin only) */
> inline fun <reified T : Any> pathParam(key: String) = pathParam(key, 
> T::class.java)
> {code}
> and used from groovy as:
> {code:java}
> def id = pathParam("id){code}
> Groovy for some reason chooses inline reified version, which of course fails 
> with: 
> {noformat}
> java.lang.UnsupportedOperationException: This function has a reified type 
> parameter and thus can only be inlined at compilation time, not called 
> directly.{noformat}
> Is there anything that can be done so groovy uses the first (non reified, 
> understandable by java and groovy) version of the method?
>  
> This bug comes from [https://github.com/tipsy/javalin/issues/574]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to