diff options
Diffstat (limited to 'src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index 60e11291c1..a035a346e6 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -307,7 +307,7 @@ abstract class ClassfileParser { val start = starts(index) if (in.buf(start).toInt != CONSTANT_CLASS) errorBadTag(start) val name = getExternalName(in.getChar(start + 1)) - if (name(0) == ARRAY_TAG) { + if (name.charAt(0) == ARRAY_TAG) { c = sigToType(null, name) values(index) = c } else { @@ -674,16 +674,16 @@ abstract class ClassfileParser { var index = 0 val end = sig.length def accept(ch: Char) { - assert(sig(index) == ch, (sig(index), ch)) + assert(sig.charAt(index) == ch, (sig.charAt(index), ch)) index += 1 } def subName(isDelimiter: Char => Boolean): Name = { val start = index - while (!isDelimiter(sig(index))) { index += 1 } + while (!isDelimiter(sig.charAt(index))) { index += 1 } sig.subName(start, index) } def sig2type(tparams: immutable.Map[Name,Symbol], skiptvs: Boolean): Type = { - val tag = sig(index); index += 1 + val tag = sig.charAt(index); index += 1 tag match { case BYTE_TAG => definitions.ByteClass.tpe case CHAR_TAG => definitions.CharClass.tpe @@ -704,12 +704,12 @@ abstract class ClassfileParser { def processClassType(tp: Type): Type = tp match { case TypeRef(pre, classSym, args) => val existentials = new ListBuffer[Symbol]() - if (sig(index) == '<') { + if (sig.charAt(index) == '<') { accept('<') val xs = new ListBuffer[Type]() var i = 0 - while (sig(index) != '>') { - sig(index) match { + while (sig.charAt(index) != '>') { + sig.charAt(index) match { case variance @ ('+' | '-' | '*') => index += 1 val bounds = variance match { @@ -745,14 +745,14 @@ abstract class ClassfileParser { res } case tp => - assert(sig(index) != '<', tp) + assert(sig.charAt(index) != '<', tp) tp } val classSym = classNameToSymbol(subName(c => c == ';' || c == '<')) assert(!classSym.isOverloaded, classSym.alternatives) var tpe = processClassType(processInner(classSym.tpe)) - while (sig(index) == '.') { + while (sig.charAt(index) == '.') { accept('.') val name = subName(c => c == ';' || c == '<' || c == '.').toTypeName val clazz = tpe.member(name) @@ -761,7 +761,7 @@ abstract class ClassfileParser { accept(';') tpe case ARRAY_TAG => - while ('0' <= sig(index) && sig(index) <= '9') index += 1 + while ('0' <= sig.charAt(index) && sig.charAt(index) <= '9') index += 1 var elemtp = sig2type(tparams, skiptvs) // make unbounded Array[T] where T is a type variable into Array[T with Object] // (this is necessary because such arrays have a representation which is incompatible @@ -778,7 +778,7 @@ abstract class ClassfileParser { // we need a method symbol. given in line 486 by calling getType(methodSym, ..) assert(sym ne null, sig) val paramtypes = new ListBuffer[Type]() - while (sig(index) != ')') { + while (sig.charAt(index) != ')') { paramtypes += objToAny(sig2type(tparams, skiptvs)) } index += 1 @@ -798,9 +798,9 @@ abstract class ClassfileParser { def sig2typeBounds(tparams: immutable.Map[Name, Symbol], skiptvs: Boolean): Type = { val ts = new ListBuffer[Type] - while (sig(index) == ':') { + while (sig.charAt(index) == ':') { index += 1 - if (sig(index) != ':') // guard against empty class bound + if (sig.charAt(index) != ':') // guard against empty class bound ts += objToAny(sig2type(tparams, skiptvs)) } TypeBounds.upper(intersectionType(ts.toList, sym)) @@ -808,11 +808,11 @@ abstract class ClassfileParser { var tparams = classTParams val newTParams = new ListBuffer[Symbol]() - if (sig(index) == '<') { + if (sig.charAt(index) == '<') { assert(sym != null, sig) index += 1 val start = index - while (sig(index) != '>') { + while (sig.charAt(index) != '>') { val tpname = subName(':'.==).toTypeName val s = sym.newTypeParameter(tpname) tparams = tparams + (tpname -> s) @@ -820,7 +820,7 @@ abstract class ClassfileParser { newTParams += s } index = start - while (sig(index) != '>') { + while (sig.charAt(index) != '>') { val tpname = subName(':'.==).toTypeName val s = tparams(tpname) s.setInfo(sig2typeBounds(tparams, false)) |