beholder
08/31/2017, 2:55 PMAutoClosable.use()
instead of Closable.use()
when class implements both interfaces? Implementation for AutoClosable is more simple and efficient.kingsley
08/31/2017, 3:57 PM(someCloseable as AutoClosable).use {}
beholder
08/31/2017, 4:18 PMkingsley
08/31/2017, 4:33 PMval foo: AutoCloseable =someCloseable
foo.use {}
I don’t really see a reason for picking one over the other anyway. Simple and efficient doesn’t sound compelling. If you are very concerned about the implementation detail, you can always make your own extension function 🙂