summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/runtime/ReflectionUtils.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2013-08-09 14:24:48 +0200
committerEugene Burmako <xeno.by@gmail.com>2013-08-13 05:05:51 +0200
commit1d28fe6c808fb9b257a2a3b24abb911bf7697d2b (patch)
tree72bc0e02d061fef0c6212edb572ae7e18199ce1b /src/reflect/scala/reflect/runtime/ReflectionUtils.scala
parented5c1abbfca18a880c79048cc7e9578ae932101d (diff)
downloadscala-1d28fe6c808fb9b257a2a3b24abb911bf7697d2b.tar.gz
scala-1d28fe6c808fb9b257a2a3b24abb911bf7697d2b.tar.bz2
scala-1d28fe6c808fb9b257a2a3b24abb911bf7697d2b.zip
[nomaster] SI-7733 reflective packages now more consistent with scalac
Previously PackageScopes from scala.reflect ignored all classes that had $'s in non-rightmost positions in their names. Unfortunately this behaviour is inconsistent with how scalac does things, and I reconciled this as usual, by pulling corresponding logic into scala-reflect.jar and sharing it between runtime reflection and compiler. This change has seprate pull requests for 2.10.x and 2.11.0. The latter deprecates `scala.tools.nsc.util.ClassPath.isTraitImplementation` whereas the former (which you're looking at right now) does not, because we can't deprecated members in minor releases.
Diffstat (limited to 'src/reflect/scala/reflect/runtime/ReflectionUtils.scala')
-rw-r--r--src/reflect/scala/reflect/runtime/ReflectionUtils.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/reflect/scala/reflect/runtime/ReflectionUtils.scala b/src/reflect/scala/reflect/runtime/ReflectionUtils.scala
index 33ad6d2430..ffed3cc38e 100644
--- a/src/reflect/scala/reflect/runtime/ReflectionUtils.scala
+++ b/src/reflect/scala/reflect/runtime/ReflectionUtils.scala
@@ -76,4 +76,10 @@ private[scala] object ReflectionUtils {
accessor setAccessible true
accessor invoke outer
}
+
+ def isTraitImplementation(fileName: String) = fileName endsWith "$class.class"
+
+ def scalacShouldntLoadClassfile(fileName: String) = isTraitImplementation(fileName)
+
+ def scalacShouldntLoadClass(name: scala.reflect.internal.SymbolTable#Name) = scalacShouldntLoadClassfile(name + ".class")
}