Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save import-benjamin/fc7ad3732fe5864ca9e8f51afd66a86d to your computer and use it in GitHub Desktop.
Save import-benjamin/fc7ad3732fe5864ca9e8f51afd66a86d to your computer and use it in GitHub Desktop.
Implicit class enhancement
package classes
object ImplicitClassSuperRichString {
implicit class SuperRichString(in:String) {
def world:String = in+", world"
}
def main(args: Array[String]): Unit = {
println("Hello" world)
println("Goodnight" world)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment