Open jurgenvinju opened 8 years ago
shouldn't it throw an exception that the .ls
field only works if isDirectory(loc)
is true? as in, the field exists, it just shoudln't be called on non directory things..
Or perhaps we should in that case always return an empty list? how do other libraries handle this?
ah, java throws an NotDirectoryException
for the java8 style api: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#newDirectoryStream-java.nio.file.Path-
This should throw a (catchable) Rascal exception for a undefined field instead of a null pointer exception.