Skip to content

Commit 81cd4de

Browse files
authored
Merge pull request #5066 from abeln/dead-code
Remove dead code in ClassFileParser
2 parents 26c4ecf + dcb506e commit 81cd4de

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,28 +1082,6 @@ class ClassfileParser(
10821082
getExternalName(in.getChar(start + 1))
10831083
}
10841084

1085-
/** Return a name and a type at the given index.
1086-
*/
1087-
private def getNameAndType(index: Int, ownerTpe: Type)(implicit ctx: Context): (Name, Type) = {
1088-
if (index <= 0 || len <= index) errorBadIndex(index)
1089-
var p = values(index).asInstanceOf[(Name, Type)]
1090-
if (p eq null) {
1091-
val start = starts(index)
1092-
if (in.buf(start).toInt != CONSTANT_NAMEANDTYPE) errorBadTag(start)
1093-
val name = getName(in.getChar(start + 1).toInt)
1094-
var tpe = getType(in.getChar(start + 3).toInt)
1095-
// fix the return type, which is blindly set to the class currently parsed
1096-
if (name == nme.CONSTRUCTOR)
1097-
tpe match {
1098-
case tp: MethodType =>
1099-
tp.derivedLambdaType(tp.paramNames, tp.paramInfos, ownerTpe)
1100-
}
1101-
p = (name, tpe)
1102-
values(index) = p
1103-
}
1104-
p
1105-
}
1106-
11071085
/** Return the type of a class constant entry. Since
11081086
* arrays are considered to be class types, they might
11091087
* appear as entries in 'newarray' or 'cast' opcodes.

0 commit comments

Comments
 (0)