Method return type missing, IDE does not complain

I have a Methode which defines an object as return type.
The method itself does not return anything.
Why does the compiler not complain ? at least a warning would be nice.

For a method hat return a object, if an object is not returned, it return NIL… It’s by design.

-Karen

thanks Karen

And, isn’t a Method that returns a value … called Function ?
(Excepted in the Xojo IDE).:grinning:

I just forget to return a value …

But at least a compiler warning would be an improvement !!!

Do you test the returned value ?

not in this case

Method is more a generic description wether it’s a function or not. If you look at the Xojo code (i. e. in text files) you can see “sub” and “function”. And these two are reserved words. And you can see the definition – sub or function – in the Xojo debugger.