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

for loops should auto cast numbers to strings (i.e. treat them as a single member list)

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: New
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2.7.51
    • Labels:
      None
    • Sprint:
      March 2018

      Description

      <cfscript>
          for (var c in "1")
              writeOutput(c);
          for (var c in 1) // throws Can't cast Object type [Number] to a value of type [collection] on line 4
              writeOutput(c);
      </cfscript>
      

      discussion https://dev.lucee.org/t/should-for-loops-auto-cast-numbers-to-strings/3653

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                michael1 Michael Offner
                Reporter:
                zac.spitzer Zac Spitzer
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: