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

Access widening for the Inliner doesn't belong in SuperAccessors

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.10.0-RC1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Followup to SI-6562.

      Private members will appear as public in the scalap output, and IntelliJ will offer these as autocompletion options.

      Test.scala

      package sandbox
      
      class C {
        private val x: Any = 1
        @inline def foo = x
      }
      

      Scalap output:

      package sandbox
      class C extends java.lang.Object {
        def this() = { /* compiled code */ }
        val x : scala.Any = { /* compiled code */ }
        @scala.inline
        def foo : scala.Any = { /* compiled code */ }
      }
      

      Another fun angle on the problem:

      ticket/6562-3 ~/code/scala cat sandbox/test.scala 
      package sandbox
      
      class C {
        private val x: Any = 1
        @inline def foo = x
      }
      ticket/6562-3 ~/code/scala cat sandbox/test_2.scala 
      package sandbox
      
      object Test {
        new C().sandbox$C$$x
      }
      ticket/6562-3 ~/code/scala /Users/jason/usr/scala-v2.10.0-RC1-15-g2c55424/pack/bin/scalac -classpath . -d . sandbox/test.scala  && /Users/jason/usr/scala-v2.10.0-RC1-15-g2c55424/pack/bin/scalac -classpath . -d . sandbox/test_2.scala 
      ticket/6562-3 ~/code/scala 
      

        Issue Links

          Activity

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

            People

            • Assignee:
              Jason Zaugg
              Reporter:
              Jason Zaugg
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Development