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

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

Diogo Kollross created FREEMARKER-12:
----------------------------------------

             Summary: #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)