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

Behaviour of scala.Dynamic depends on implementation details of superclasses

    Details

      Description

      This code compiles...

      abstract class Prova2 extends Dynamic {
        def applyDynamic(m: String)(): Unit
        //private def privateMethod() = ()
      }
      
      object Prova extends App {
        val prova= new Prova2 {
          def applyDynamic(m: String)() = ()
        }
        prova.privateMethod()
      }
      

      ... but if you uncomment that privateMethod declaration, it fails to compile:
      Prova.scala:5: error: method privateMethod in class Prova2 cannot be accessed in Prova2
      prova.privateMethod()
      ^

        Activity

        Hide
        Jordi Salvat i Alabart added a comment -

        Sorry I didn't comment on this earlier.

        I proposed a patch for this issue in https://github.com/scala/scala/pull/98 – together with a fix for SI-4536. Let me know if you need two separate patches.

        Show
        Jordi Salvat i Alabart added a comment - Sorry I didn't comment on this earlier. I proposed a patch for this issue in https://github.com/scala/scala/pull/98 – together with a fix for SI-4536 . Let me know if you need two separate patches.
        Hide
        Paul Phillips added a comment -

        See my comment on SI-4536, which I will reproduce so you don't have to: "I don't know what happened, but that link to github is to an xml equality patch. Does the patch still exist somewhere?"

        Show
        Paul Phillips added a comment - See my comment on SI-4536 , which I will reproduce so you don't have to: "I don't know what happened, but that link to github is to an xml equality patch. Does the patch still exist somewhere?"
        Hide
        Jordi Salvat i Alabart added a comment -

        Apparently repositories were renamed: https://github.com/scala/legacy-svn-scala/pull/98

        Show
        Jordi Salvat i Alabart added a comment - Apparently repositories were renamed: https://github.com/scala/legacy-svn-scala/pull/98
        Hide
        Paul Phillips added a comment -

        Thanks. Things have moved far enough I had to reboot the code, but your participation has been appreciated. Fixed in 780bed7fbb .

        Show
        Paul Phillips added a comment - Thanks. Things have moved far enough I had to reboot the code, but your participation has been appreciated. Fixed in 780bed7fbb .

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Jordi Salvat i Alabart
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development