Scala Programming Language
  1. Scala Programming Language
  2. SI-8132

Overriding protected member in case class constructor

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.10.3
    • Fix Version/s: Scala 2.11.0-M8
    • Component/s: Misc Compiler
    • Labels:
    • Environment:

      Windows 8.1 Enterprise 64bit
      Java HotSpot(TM) 64-Bit Server VM
      Java 1.7.0_45

      Description

      trait T {
        protected def s: String
      }
      
      case class G(override protected val s: String) extends T
      

      This code results in a compile error:

      <console>:11: error: value s$1 overrides nothing
             case class G(override protected val s: String) extends T
                        ^
      

      More detailed explanation of this error is in
      http://stackoverflow.com/questions/21019966/scala-override-protected-val-results-in-error-when-defining-case-class-constr

        Activity

        Show
        Jason Zaugg added a comment - https://github.com/scala/scala/pull/3369

          People

          • Assignee:
            Jason Zaugg
            Reporter:
            Eun, Naetmul
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development