You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by "Daniel Dekany (JIRA)" <ji...@apache.org> on 2015/11/18 21:19:11 UTC

[jira] [Commented] (FREEMARKER-12) #return value bubbles through functions

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

Daniel Dekany commented on FREEMARKER-12:
-----------------------------------------

While this would be trivial to fix, it can't be fixed as that breaks backward compatibility. I'm afraid this will require the {{incompatibleImprovements}} configuration setting to be set to 2.4.0, hence the fix can't be present in the 2.3.x series.

> #return value bubbles through functions
> ---------------------------------------
>
>                 Key: FREEMARKER-12
>                 URL: https://issues.apache.org/jira/browse/FREEMARKER-12
>             Project: Apache Freemarker
>          Issue Type: Bug
>    Affects Versions: 2.3.23
>            Reporter: Diogo Kollross
>
> The documentation says that "if ... there was no 'return returnValue', then the return value of the method is an undefined variable", but the behaviour I'm seeing is that any #return in inner method calls gets returned as if it was the caller's return value.
> In the following example the expected result is an undefined value, but it shows "inner value".
> {noformat}
> <#function inner>
>   <#return "inner value">
> </#function>
> <#function example>
>   <#local temp = inner()>
> </#function>
> ${example()}
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)