Skip to content

Instantly share code, notes, and snippets.

@devrath
Created October 3, 2021 03:20
Show Gist options
  • Select an option

  • Save devrath/32f5315522f4e63eee9ce2e3e5abb648 to your computer and use it in GitHub Desktop.

Select an option

Save devrath/32f5315522f4e63eee9ce2e3e5abb648 to your computer and use it in GitHub Desktop.
// Define the type alisas in a class
import pkgone.MyViewClass
typealias PkgOneClass = MyViewClass
typealias PkgTwoClass = pkgtwo.MyViewClass
typealias PkgThreeClass = pkgthree.MyViewClass
// Main function
fun main() {
println("Start")
pkgone.MyViewClass().display()
pkgtwo.MyViewClass().display()
pkgthree.MyViewClass().display()
println("End")
}
// ----> MyViewClass in pkgone
package pkgone
class MyViewClass {
fun display(){
println("PKG-ONE: "+"😎😎😎")
}
}
// ----> MyViewClass in pkgtwo
package pkgtwo
class MyViewClass {
fun display(){
println("PKG-TWO: "+"😎😎😎")
}
}
// ----> MyViewClass in pkgthree
package pkgthree
class MyViewClass {
fun display(){
println("PKG-Three: "+"😎😎😎")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment