Skip to content

Commit 8348386

Browse files
committed
Add a guard against empty ident
1 parent 4eabca5 commit 8348386

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/semanticdb/Scala3.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ object Scala3:
416416
unicodeEscape.replaceAllIn(symbol, m => String.valueOf(Integer.parseInt(m.group(1), 16).toChar).nn)
417417

418418
def isJavaIdent =
419-
isJavaIdentifierStart(symbol.head) && symbol.tail.forall(isJavaIdentifierPart)
419+
symbol.nonEmpty && isJavaIdentifierStart(symbol.head) && symbol.tail.forall(isJavaIdentifierPart)
420420
end StringOps
421421

422422
given InfoOps: AnyRef with

0 commit comments

Comments
 (0)