CFLint icon indicating copy to clipboard operation
CFLint copied to clipboard

UNUSED_LOCAL_VARIABLE false positive with var used in hashes

Open Vintic opened this issue 6 years ago • 2 comments

Unused variable on line 3

<cfcomponent displayname="myComponent">
    <cffunction name="getData">
        <cfset var testVar = 123>

        <cfsavecontent variable = "sql_query">
            <cfoutput>
                SELECT #testVar#
            </cfoutput>
        </cfsavecontent>
    </cffunction>
</cfcomponent>

related: https://github.com/cflint/CFLint/issues/464

Vintic avatar Feb 21 '20 12:02 Vintic

if cfoutput contains any text, before, or after #testVar#, bug is reported

Vintic avatar Feb 21 '20 12:02 Vintic

SyntaxError: Line1:10 no viable alternative at input '#testVar#asd'

Vintic avatar Feb 21 '20 12:02 Vintic