Created
April 16, 2014 15:44
-
-
Save xuwei-k/10896517 to your computer and use it in GitHub Desktop.
This file contains 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
import java.io.File | |
trait FileNameIsHogeHoge { self: File => | |
override def getPath: String = "hogehoge" | |
} | |
class MyFile(name: String) extends File(name) with FileNameIsHogeHoge | |
object Main extends App{ | |
val f = new MyFile("/tmp/file.txt") | |
assert(f.getPath == "hogehoge") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment