I don't think "directly inside a package" means anything that specific...anyway the whole line is "Functions, properties and classes, objects and interfaces can be declared on the "top-level", i.e. directly inside a package:" which doesn't make any distinction between classes/objects vs functions which @James Coggan showed earlier works.