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

Functions return "image" are incorrectly typed as returning numeric

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 4.5.1.000
    • Fix Version/s: 5.1.1.38
    • Labels:
      None

      Description

      Functions returning a type called "image" are misinterpreted as returning numeric. This worked in Railo 4.1.2.005.

      To reproduce:

      Create the following files in the same directory.

      test.cfm

      Unable to find source-code formatter for language: cfml. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      <cfscript>
        image function getImage() {
          return new image();
        }
       
        dump(getImage());
      </cfscript>
      ```
      
      image.cfc
      
      ```
      #!cfml
      
      component {}
      ```
      
      Load test.cfm in your browser. See that an exception is raised:
      ```
      the function getImage has an invalid return value , can't cast Object type [Component image] to a value of type [numeric]
      

      This works fine if you change "image" to "imagex" (in the test code and object filename), so there's something special about the name "image".

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              sbleon sbleon (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: