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

"Trying to access the this of another class" or "symbol value x$4$1 does not exist" when compiling code involving anonymous functions, multiple parameter lists and default arguments

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Scala 2.10.0-M3, Scala 2.10.0
    • Component/s: None
    • Labels:
      None

      Description

      this code

      class C {
        case class M(currentUser: String)(message: String = "")
        def model = Option(M("")()).getOrElse(M("")()).copy(currentUser = "")()
      }
      

      leads to Error: symbol value x$4$1 does not exist in C.model in 2.9.1 and 2.9.2
      or something like the following in later versions
      uncaught exception during compilation: java.lang.AssertionError
      java.lang.AssertionError: assertion failed:
      while compiling: <console>
      current phase: icode
      library version: version 2.10.0-20120428-143539-774cd4f87b
      compiler version: version 2.10.0-20120428-143539-774cd4f87b
      reconstructed args:

      Trying to access the this of another class: tree.symbol = class $read$$iw$$iw$C,
      ctx.clazz.symbol = anonymous class $read$$iw$$iw$C$$anonfun$1 compilation unit:
      <console>
      at scala.Predef$.assert(Predef.scala:182)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$bac
      kend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:944)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadQualifier(Ge
      nICode.scala:1151)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                apm A. P. Marki
                Reporter:
                olegych Oleg Aleshko
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: