After extending java.io.File and making it comply to protocol is and as? operators will fail to identify the instance as being of type java.io.File.
When creating my own class, extending, and making it comply to the very same protocol, works fine.
So this works (well partially); when you have a File and cast it to AnyFileOrDirectory (which is an extension) it works, is works too. When you have an Object/Any containing a File it won’t work unfortunately, that’s a runtime limitation.