I would like to disable automatic import of stdlib...
# announcements
s
I would like to disable automatic import of stdlib’s Result class, as I have my own implementation, but imports are always breaking as stdlib implementation has priority. Anyone knows how to deal with this?
b
I generally try to avoid naming things the same. Is there something about your class that differentiates it from the stdlib's? You might be able to name it based on that
s
Classes often have the same name (f.e. JDK class vs Android SDK bundled equivalent) and it isn't a problem. Problem is, using Result class from stdlib doesn't involve explicit import at top of file. I want to get rid of it, as all usage is implied to be kotlin.Result and it's super annoying. You don't get a choice what you want to use unless you write/paste this import yourself.
v
As I see it you have two options: 1. Always use your Result classes’ fully qualified name. 2. You could do this in files where you use your result class :
import kotlin.Result as KResult
Neither is a great workaround.