Closed
Description
import java.io.{File}
abstract sealed trait Path {
val path: String
val name: String
}
case class ExternalPath(path: String) extends File(path) with Path {
override lazy val name: String = getName
}
$ scalac -version
Scala compiler version 2.10.0.dev-1302-g6a33a20 -- Copyright 2002-2011, LAMP/EPFL
$ scala z.scala
$
$ scala -optimize z.scala
/tmp/z.scala:6: error: overriding value path in trait Path of type String;
variable path in class File of type String has weaker access privileges; it should not be private
case class ExternalPath(path: String) extends File(path) with Path {
^
one error found
$