Skip to content
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

Add a guard against empty ident #15542

Merged
merged 1 commit into from
Jun 28, 2022
Merged

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Jun 28, 2022

Got this in a stack trace why working with Metals:

Exception in thread "pool-5-thread-2" java.util.NoSuchElementException: head of empty String
        at scala.collection.StringOps$.head$extension(StringOps.scala:1129)
        at dotty.tools.dotc.semanticdb.Scala3$StringOps$.isJavaIdent(Scala3.scala:419)
        at dotty.tools.dotc.semanticdb.SemanticSymbolBuilder.addName(SemanticSymbolBuilder.scala:63)
        at dotty.tools.dotc.semanticdb.SemanticSymbolBuilder.addDescriptor$1(SemanticSymbolBuilder.scala:109)
        at dotty.tools.dotc.semanticdb.SemanticSymbolBuilder.addSymName(SemanticSymbolBuilder.scala:146)
        at dotty.tools.dotc.semanticdb.SemanticSymbolBuilder.symbolName(SemanticSymbolBuilder.scala:29)
        at dotty.tools.dotc.semanticdb.Scala3$SymbolOps$.symbolName(Scala3.scala:266)
        at dotty.tools.dotc.semanticdb.ExtractSemanticDB$Extractor.registerUse(ExtractSemanticDB.scala:344)
        at dotty.tools.dotc.semanticdb.ExtractSemanticDB$Extractor.registerUseGuarded(ExtractSemanticDB.scala:341)
        at dotty.tools.dotc.semanticdb.ExtractSemanticDB$Extractor.traverse$$anonfun$15$$anonfun$1(ExtractSemanticDB.scala:250)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:333)
        at dotty.tools.dotc.semanticdb.ExtractSemanticDB$Extractor.traverse$$anonfun$15(ExtractSemanticDB.scala:256)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:333)
        at dotty.tools.dotc.semanticdb.ExtractSemanticDB$Extractor.traverse(ExtractSemanticDB.scala:256)
        at dotty.tools.dotc.semanticdb.ExtractSemanticDB$Extractor.traverse$$anonfun$1(ExtractSemanticDB.scala:140)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:333)
        at dotty.tools.dotc.semanticdb.ExtractSemanticDB$Extractor.traverse(ExtractSemanticDB.scala:140)
        at scala.meta.internal.pc.SemanticdbTextDocumentProvider.textDocument(SemanticdbTextDocumentProvider.scala:39)
        at scala.meta.internal.pc.ScalaPresentationCompiler.semanticdbTextDocument$$anonfun$1(ScalaPresentationCompiler.scala:138)
        at scala.meta.internal.pc.CompilerAccess.withSharedCompiler(CompilerAccess.scala:137)
        at scala.meta.internal.pc.CompilerAccess.withNonInterruptableCompiler$$anonfun$1(CompilerAccess.scala:125)
        at scala.meta.internal.pc.CompilerAccess.onCompilerJobQueue$$anonfun$1(CompilerAccess.scala:197)
        at scala.meta.internal.pc.CompilerJobQueue$Job.run(CompilerJobQueue.scala:139)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

@tgodzik tgodzik requested a review from prolativ June 28, 2022 13:46
@tgodzik tgodzik merged commit 65a86ae into scala:main Jun 28, 2022
@tgodzik tgodzik deleted the guard-against-empty branch June 28, 2022 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants