Skip to content

Commit cdb202d

Browse files
committed
Only collect simple names when reading unpickler name tables
1 parent 4cfb00f commit cdb202d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/src/dotty/tools/dotc/core/tasty/DottyUnpickler.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ class DottyUnpickler(bytes: Array[Byte]) extends ClassfileParser.Embedded with t
5454
private[this] var ids: Array[String] = null
5555

5656
override def mightContain(id: String)(implicit ctx: Context): Boolean = {
57-
if (ids == null) ids = unpickler.nameAtRef.contents.toArray.map(_.toString).sorted
57+
if (ids == null)
58+
ids =
59+
unpickler.nameAtRef.contents.toArray.collect {
60+
case name: SimpleName => name.toString
61+
}.sorted
5862
ids.binarySearch(id) >= 0
5963
}
6064
}

0 commit comments

Comments
 (0)