summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2011-11-10 23:57:01 +0000
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2011-11-10 23:57:01 +0000
commitd01ab1ba466c1c4778505ff4aa1747dde7309052 (patch)
treec0938296043d800871826ca6844748d9a52f289f /src/compiler
parent10f7a8c465a71d29c36884ff85f371ea8e364023 (diff)
downloadscala-d01ab1ba466c1c4778505ff4aa1747dde7309052.tar.gz
scala-d01ab1ba466c1c4778505ff4aa1747dde7309052.tar.bz2
scala-d01ab1ba466c1c4778505ff4aa1747dde7309052.zip
Allow to load $class classes using Scala reflec...
Allow to load $class classes using Scala reflection. Tweaked implementation of invalidClassName method to exclude *$class clasess from the set of invalid names. It's not exactly clear what was the intent of this method in first place so I'm not sure if it's the best way to fix SI-5176. Added test-case that covers this issue. Fixes SI-5176. Review by odersky.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/reflect/runtime/Loaders.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/reflect/runtime/Loaders.scala b/src/compiler/scala/reflect/runtime/Loaders.scala
index 46ee176b0f..ad6bf34591 100644
--- a/src/compiler/scala/reflect/runtime/Loaders.scala
+++ b/src/compiler/scala/reflect/runtime/Loaders.scala
@@ -90,7 +90,10 @@ trait Loaders { self: SymbolTable =>
def invalidClassName(name: Name) = {
val dp = name pos '$'
- 0 < dp && dp < (name.length - 1)
+ //it's not clear what's the definition of an invalid class name but
+ //implementation class is certainly a valid class that we would
+ //like to load (grek)
+ 0 < dp && dp < (name.length - 1) && !nme.isImplClassName(name)
}
class PackageScope(pkgClass: Symbol) extends Scope {