Skip to content

Remove dead code in ClassFileParser #5066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1082,28 +1082,6 @@ class ClassfileParser(
getExternalName(in.getChar(start + 1))
}

/** Return a name and a type at the given index.
*/
private def getNameAndType(index: Int, ownerTpe: Type)(implicit ctx: Context): (Name, Type) = {
if (index <= 0 || len <= index) errorBadIndex(index)
var p = values(index).asInstanceOf[(Name, Type)]
if (p eq null) {
val start = starts(index)
if (in.buf(start).toInt != CONSTANT_NAMEANDTYPE) errorBadTag(start)
val name = getName(in.getChar(start + 1).toInt)
var tpe = getType(in.getChar(start + 3).toInt)
// fix the return type, which is blindly set to the class currently parsed
if (name == nme.CONSTRUCTOR)
tpe match {
case tp: MethodType =>
tp.derivedLambdaType(tp.paramNames, tp.paramInfos, ownerTpe)
}
p = (name, tpe)
values(index) = p
}
p
}

/** Return the type of a class constant entry. Since
* arrays are considered to be class types, they might
* appear as entries in 'newarray' or 'cast' opcodes.
Expand Down