Hi Martin Thanks for your reply. So a return type of 'void|object' means this function may return either an object or nothing at all. But if it returns nothing there won't be an error, because the missing value is converted to 0? Whereas if the return type were just 'object' and you returned nothing, the compiler would complain? Hope I've got that right, because that does make a lot more sense :)
Though in that case, surely there's no point to SDL.get_video_info() returning type 'void|object', because there's never going to be a scenario where it doesn't return anything. It's always going to return either an object or 0, both of which you can assign to an object and which you'd test in exactly the same way:
if ( object o = SDL.get_video_info() ) { // success }
Best wishes, larcky.