We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
package foo; class PackagePrivateJavaClass { private PackagePrivateJavaClass() {} protected PackagePrivateJavaClass(int x) {} public PackagePrivateJavaClass(int x, int y) {} } ==== import scala.reflect.runtime.universe._ package object foo { def testAll(): Unit = { test(typeOf[foo.PackagePrivateJavaClass].typeSymbol) } def test(sym: Symbol): Unit = { printSymbolDetails(sym) if (sym.isClass || sym.isModule) { sym.typeSignature.declarations.toList.sortBy(_.name.toString) foreach test } } def printSymbolDetails(sym: Symbol): Unit = { def stableSignature(sym: Symbol) = sym.typeSignature match { case ClassInfoType(_, _, _) => "ClassInfoType(...)" case tpe => tpe.toString } println("============") println(s"sym = $sym, signature = ${stableSignature(sym)}, owner = ${sym.owner}") println(s"isPrivate = ${sym.isPrivate}") println(s"isProtected = ${sym.isProtected}") println(s"isPublic = ${sym.isPublic}") println(s"privateWithin = ${sym.privateWithin}") } } object Test extends App { foo.testAll() }
============ sym = class PackagePrivateJavaClass, signature = ClassInfoType(...), owner = package foo isPrivate = false isProtected = false isPublic = false privateWithin = package foo ============ sym = constructor PackagePrivateJavaClass, signature = (x$1: Int, x$2: Int)foo.PackagePrivateJavaClass, owner = class PackagePrivateJavaClass isPrivate = false isProtected = false isPublic = true privateWithin = <none>
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-7071?orig=1 Reporter: @xeno-by Affected Versions: 2.10.0
Sorry, something went wrong.
closing many stale scala.reflect tickets
No branches or pull requests
The text was updated successfully, but these errors were encountered: