From d01ab1ba466c1c4778505ff4aa1747dde7309052 Mon Sep 17 00:00:00 2001 From: Grzegorz Kossakowski Date: Thu, 10 Nov 2011 23:57:01 +0000 Subject: 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. --- src/compiler/scala/reflect/runtime/Loaders.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/compiler') 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 { -- cgit v1.2.3