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

Typed Functions fail to return nulls (and throw an error)

    Details

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

      Description

      When implementing full support for nulls, it seems that functions ALWAYS expect to return an object. So for example:

      component {
         public Person function init(boolean returnNull=false){
            if(returnNull) { 
               return null; 
            }
            return this;
         }
      }
      ```
      the function should return a Person or a null (which is the point of nulls) so if we call:
      
      ```
      #!javascript
      myPerson = new Person();
      myFailedPerson = new Person(true);
      

      The second call will fail.

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              michaeloffner Michael Offner
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: