Skip to content

Optimiser disagrees with compiler over what syntax is valid #5322

Closed
@scabug

Description

@scabug

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
$

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions