@@ -247,22 +247,21 @@ class ClassfileParser(
247
247
final def objToAny (tp : Type )(implicit ctx : Context ) =
248
248
if (tp.isDirectRef(defn.ObjectClass ) && ! ctx.phase.erasedTypes) defn.AnyType else tp
249
249
250
- private def sigToType (signature : TermName , owner : Symbol = null )(implicit ctx : Context ): Type = {
251
- val sig = signature.toSimpleName
250
+ private def sigToType (sig : SimpleTermName , owner : Symbol = null )(implicit ctx : Context ): Type = {
252
251
var index = 0
253
252
val end = sig.length
254
253
def accept (ch : Char ): Unit = {
255
254
assert(sig(index) == ch, (sig(index), ch))
256
255
index += 1
257
256
}
258
- def subName (isDelimiter : Char => Boolean ): TermName = {
257
+ def subName (isDelimiter : Char => Boolean ): SimpleTermName = {
259
258
val start = index
260
259
while (! isDelimiter(sig(index))) { index += 1 }
261
- sig.slice(start, index).asTermName
260
+ sig.slice(start, index)
262
261
}
263
262
// Warning: sigToType contains nested completers which might be forced in a later run!
264
263
// So local methods need their own ctx parameters.
265
- def sig2type (tparams : immutable.Map [Name ,Symbol ], skiptvs : Boolean )(implicit ctx : Context ): Type = {
264
+ def sig2type (tparams : immutable.Map [Name , Symbol ], skiptvs : Boolean )(implicit ctx : Context ): Type = {
266
265
val tag = sig(index); index += 1
267
266
(tag : @ switch) match {
268
267
case BYTE_TAG => defn.ByteType
@@ -895,7 +894,7 @@ class ClassfileParser(
895
894
private val len = in.nextChar
896
895
private val starts = new Array [Int ](len)
897
896
private val values = new Array [AnyRef ](len)
898
- private val internalized = new Array [TermName ](len)
897
+ private val internalized = new Array [SimpleTermName ](len)
899
898
900
899
{ var i = 1
901
900
while (i < starts.length) {
@@ -922,12 +921,12 @@ class ClassfileParser(
922
921
}
923
922
924
923
/** Return the name found at given index. */
925
- def getName (index : Int ): TermName = {
924
+ def getName (index : Int ): SimpleTermName = {
926
925
if (index <= 0 || len <= index)
927
926
errorBadIndex(index)
928
927
929
928
values(index) match {
930
- case name : TermName => name
929
+ case name : SimpleTermName => name
931
930
case null =>
932
931
val start = starts(index)
933
932
if (in.buf(start).toInt != CONSTANT_UTF8 ) errorBadTag(start)
@@ -938,12 +937,12 @@ class ClassfileParser(
938
937
}
939
938
940
939
/** Return the name found at given index in the constant pool, with '/' replaced by '.'. */
941
- def getExternalName (index : Int ): TermName = {
940
+ def getExternalName (index : Int ): SimpleTermName = {
942
941
if (index <= 0 || len <= index)
943
942
errorBadIndex(index)
944
943
945
944
if (internalized(index) == null )
946
- internalized(index) = getName(index).replace('/' , '.' ).unmangleClassName
945
+ internalized(index) = getName(index).replace('/' , '.' )
947
946
948
947
internalized(index)
949
948
}
@@ -955,9 +954,9 @@ class ClassfileParser(
955
954
val start = starts(index)
956
955
if (in.buf(start).toInt != CONSTANT_CLASS ) errorBadTag(start)
957
956
val name = getExternalName(in.getChar(start + 1 ))
958
- if (name.is( ModuleClassName ) && (name ne nme.nothingRuntimeClass) && (name ne nme.nullRuntimeClass))
957
+ if (name.endsWith( " $ " ) && (name ne nme.nothingRuntimeClass) && (name ne nme.nullRuntimeClass))
959
958
// Null$ and Nothing$ ARE classes
960
- c = ctx.requiredModule(name.sourceModuleName )
959
+ c = ctx.requiredModule(name.dropRight( 1 ) )
961
960
else c = classNameToSymbol(name)
962
961
values(index) = c
963
962
}
@@ -967,7 +966,7 @@ class ClassfileParser(
967
966
/** Return the external name of the class info structure found at 'index'.
968
967
* Use 'getClassSymbol' if the class is sure to be a top-level class.
969
968
*/
970
- def getClassName (index : Int ): TermName = {
969
+ def getClassName (index : Int ): SimpleTermName = {
971
970
val start = starts(index)
972
971
if (in.buf(start).toInt != CONSTANT_CLASS ) errorBadTag(start)
973
972
getExternalName(in.getChar(start + 1 ))
0 commit comments