Uploaded image for project: 'Lucee Development'
  1. LDEV-255

Inability to refer to static members dynamically

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.0.0.96
    • Fix Version/s: 5.0.0.109
    • Labels:

      Description

      I would expect the ability to refer to static members dynamically, either the component name, the member name or both.

      Examples (and errors received)

      //testStatic.cfc
      component {
      	static {
      		f = () -> true;
      	}
      }
      
      //index.cfm
      <cfscript>
      	c = "testStatic";
      	m = "f";
      
      	dump(testStatic::f()); //normal syntax, not dynamic
      	//dump(testStatic::[m]()); //invalid identifier
      	//dump(testStatic::"f"()); //invalid identifier
      	//dump(testStatic::["f"]()); //invalid identifier
      	//dump(testStatic::"#m#"()); //invalid identifier
      	//dump([c]::f()); //Syntax Error, Invalid Construct
      </cfscript>
      

      I don't necessarily expect all of those syntaxes to work, but was just trying to see if there was any way to make it work.

      My preferred syntax would be that anything in brackets would be evaluated:

      [c]::[m]()
      

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                michaeloffner Michael Offner
                Reporter:
                ryanguill Ryan Guill
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: