Skip to content

Commit 216d0dc

Browse files
committed
More lenient checking of name mismatches in ClassfileParser
1 parent dccf1b0 commit 216d0dc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ class ClassfileParser(
9292
val nameIdx = in.nextChar
9393
currentClassName = pool.getClassName(nameIdx)
9494

95-
if (currentIsTopLevel && currentClassName != classRoot.fullName.toSimpleName)
95+
if (currentIsTopLevel &&
96+
currentClassName != classRoot.fullName.toSimpleName &&
97+
currentClassName != classRoot.fullName.encode.toSimpleName)
9698
mismatchError(currentClassName)
9799

98100
addEnclosingTParams()

compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
206206
protected def TypeParamRefNameString(param: TypeParamRef): String =
207207
TypeParamRefNameString(param.binder.paramNames(param.paramNum))
208208

209-
/** The name of the symbol without a unique id. Under refined printing,
210-
* the decoded original name.
211-
*/
209+
/** The name of the symbol without a unique id. */
212210
protected def simpleNameString(sym: Symbol): String = nameString(sym.name)
213211

214212
/** If -uniqid is set, the hashcode of the lambda type, after a # */

0 commit comments

Comments
 (0)