In the same vein, what about ``` import javafx.sce...
# announcements
r
In the same vein, what about
Copy code
import javafx.scene.paint.Color as ColorFX
and
Copy code
typealias ColorFX as javafx.scene.paint.Color
p
The difference is that
typealias
is
public
by default and will be accessible outside of a file. So you may want to declare it
private
. Also you can access
typealias
by a full qualified name, while named import by that name only.
But at runtime there should not be any difference.
r
Ah, indeed. Both are very good points. Thanks!
d
Also it might be worth mentioning that in my experience, typealiases are the most reliable way to crash the Kotlin compiler, so use other techniques if I can
😁 1
r
@dmcg I prefer to use complex hierarchies of nested generics 🙂
d
Complex hierarchies of nested generic typealiases it is then
😱 1