Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-5322

Optimiser disagrees with compiler over what syntax is valid

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.10.0
    • Fix Version/s: Backlog
    • Component/s: Compiler (Misc), Optimizer
    • Labels:
      None
    • Environment:

      Scala compiler version 2.10.0.dev-1302-g6a33a20 – Copyright 2002-2011, LAMP/EPFL

      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
      $

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alanbur Alan Burlison
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: