Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

privateWithin is broken for java package private objects #6989

Closed
scabug opened this issue Jan 18, 2013 · 5 comments
Closed

privateWithin is broken for java package private objects #6989

scabug opened this issue Jan 18, 2013 · 5 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Jan 18, 2013

The documentation for privateWithin says:

     *  The java access levels translate as follows:
     *
     *  java private:     isPrivate                  && (privateWithin == NoSymbol)
     *  java package:     !isPrivate && !isProtected && (privateWithin == enclosingPackage)
     *  java protected:   isProtected                && (privateWithin == enclosingPackage)
     *  java public:      !isPrivate && !isProtected && (privateWithin == NoSymbol)

However, here's what I get for getPrefixLength in java.io.File (which is package private):

Welcome to Scala version 2.10.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_09).
Type in expressions to have them evaluated.
Type :help for more information.

scala> import reflect.runtime.universe._
import reflect.runtime.universe._

scala> val t = weakTypeOf[java.io.File]
t: reflect.runtime.universe.Type = java.io.File

scala> val m = t.member(newTermName("getPrefixLength"))
m: reflect.runtime.universe.Symbol = method getPrefixLength

scala> m.isPrivate
res0: Boolean = false

scala> m.isProtected
res1: Boolean = false

scala> m.privateWithin
res2: reflect.runtime.universe.Symbol = <none>

scala> m.isPublic
res3: Boolean = true
@scabug
Copy link
Author

scabug commented Jan 18, 2013

Imported From: https://issues.scala-lang.org/browse/SI-6989?orig=1
Reporter: @paulbutcher
Affected Versions: 2.10.0

@scabug
Copy link
Author

scabug commented Jan 31, 2013

@xeno-by said:
scala/scala#2035

@scabug
Copy link
Author

scabug commented Feb 9, 2013

@adriaanm said:
Due to binary compatibility reasons, this cannot go into 2.10.1-RC1.

@scabug
Copy link
Author

scabug commented Feb 9, 2013

@adriaanm said:
scala/scala#2103

@scabug
Copy link
Author

scabug commented Feb 10, 2013

@adriaanm said:
PR amended to leave the fix in by refactoring it to be binary compatible

@scabug scabug closed this as completed Feb 10, 2013
@scabug scabug added this to the 2.10.1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants