Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARG_VAR_MIXED reported when implicit struct has key equal to argument #478

Closed
rcastagno opened this issue Oct 13, 2017 · 1 comment
Closed

Comments

@rcastagno
Copy link

Scanning this should not give such error

<cfcomponent displayname="mycomponent">
    <cffunction name="myfunction" returntype="void">
    <cfargument name="myvariable" type="string" required="true">
        <cfscript>
            var mystructure = {myvariable = arguments.myvariable};
        </cfscript>
    </cffunction>
</cfcomponent>

Error goes away if I write either:

<cfcomponent displayname="mycomponent">
    <cffunction name="myfunction" returntype="void">
    <cfargument name="myvariable" type="string" required="true">
        <cfscript>
            var mystructure = {anothername = arguments.myvariable};
        </cfscript>
    </cffunction>
</cfcomponent>

or

<cfcomponent displayname="mycomponent">
    <cffunction name="myfunction" returntype="void">
    <cfargument name="myvariable" type="string" required="true">
        <cfscript>
            var mystructure = {myvariable = ''};
        </cfscript>
    </cffunction>
</cfcomponent>

Keys of implicit structs should be between quotes, but as far as I know it's not required.

ryaneberly added a commit that referenced this issue Oct 14, 2017
@ryaneberly
Copy link
Contributor

fixed in dev branch. Thanks @rcastagno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants