Last active
August 29, 2015 13:57
-
-
Save Shinpeim/9722522 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Nyan { | |
class A { | |
def nyan = "A" | |
} | |
implicit class B (self:A){ | |
def nyan = "B" | |
def wan = "B" | |
} | |
def main(args:Array[String]) = { | |
val a = new A | |
println(a.nyan) | |
println(a.wan) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> run | |
[info] Compiling 1 Scala source to /Users/shinpei/nekogata/nyan/target/scala-2.10/classes... | |
[info] Running Nyan | |
A | |
B | |
[success] Total time: 1 s, completed 2014/03/23 21:39:26 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment