In a situation where I have multiple naming conflicts and I might need to add multiple typealias / import alias (import … as Alias), I was wondering if there is a way to create an alias to a package, like typealias or import alias…
For examples, we could simplify the following code:
import com.example.ViewModel as ExampleViewModel Import com.example.Navigator as ExampleNavigator import com.simple.ViewModel as SimpleViewModel Import com.simple.Navigator as SimpleNavigator
By something like that:
typealias Example = com.example typealias Simple = com.simple // Another File on root package import Example // or maybe something similar to this: import com.simple as Simple val viewModel = Example.ViewModel() val navigator = Simple.Navigator()
The code presented here doesn’t work. Does Kotlin support something similar?