Skip to content

"... already has a symbol" assertion in the IDE when trying to complete "scala." #2809

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

Closed
smarter opened this issue Jun 25, 2017 · 1 comment

Comments

@smarter
Copy link
Member

smarter commented Jun 25, 2017

To reproduce:

  1. sbt launchIDE
  2. Type scala.
  3. Boom:
java.lang.AssertionError: assertion failed: scala.languageFeature$experimental$$.macros$ already has a symbol
        at scala.Predef$.assert(Predef.scala:170)
        at dotty.tools.dotc.core.SymbolLoaders.enterNew(SymbolLoaders.scala:35)
        at dotty.tools.dotc.core.SymbolLoaders.enterModule(SymbolLoaders.scala:59)
        at dotty.tools.dotc.core.SymbolLoaders.enterClassAndModule(SymbolLoaders.scala:102)
        at dotty.tools.dotc.core.classfile.ClassfileParser.enterClassAndModule$1(ClassfileParser.scala:681)
        at dotty.tools.dotc.core.classfile.ClassfileParser.enterOwnInnerClasses$$anonfun$1(ClassfileParser.scala:690)
        at scala.compat.java8.JProcedure1.apply(JProcedure1.java:18)
        at scala.compat.java8.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.mutable.HashMap$$anon$2$$anonfun$foreach$3.apply(HashMap.scala:139)
        at scala.collection.mutable.HashMap$$anon$2$$anonfun$foreach$3.apply(HashMap.scala:139)
        at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:236)
        at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
        at scala.collection.mutable.HashMap$$anon$2.foreach(HashMap.scala:139)
        at dotty.tools.dotc.core.classfile.ClassfileParser.enterOwnInnerClasses(ClassfileParser.scala:692)
        at dotty.tools.dotc.core.classfile.ClassfileParser.parseClass(ClassfileParser.scala:130)
        at dotty.tools.dotc.core.classfile.ClassfileParser.run(ClassfileParser.scala:59)
        at dotty.tools.dotc.core.ClassfileLoader.load(SymbolLoaders.scala:326)
        at dotty.tools.dotc.core.ClassfileLoader.doComplete(SymbolLoaders.scala:322)
        at dotty.tools.dotc.core.SymbolLoader.complete(SymbolLoaders.scala:272)
        at dotty.tools.dotc.core.SymDenotations$$anon$54.complete(SymDenotations.scala:1843)
        at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:228)
        at dotty.tools.dotc.core.SymDenotations$SymDenotation.info(SymDenotations.scala:206)
        at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:345)
        at dotty.tools.dotc.core.SymDenotations$SymDenotation.flags(SymDenotations.scala:149)
        at dotty.tools.dotc.core.SymDenotations$ModuleCompleter.complete(SymDenotations.scala:1881)
        at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:228)
        at dotty.tools.dotc.core.SymDenotations$SymDenotation.info(SymDenotations.scala:206)
        at dotty.tools.dotc.core.SymDenotations$SymDenotation.isAccessibleFrom(SymDenotations.scala:707)
        at dotty.tools.dotc.interactive.Interactive$.completions$$anonfun$2$$anonfun$1(Interactive.scala:91)
        at dotty.tools.dotc.core.Denotations$SingleDenotation.altsWith(Denotations.scala:625)
        at dotty.tools.dotc.interactive.Interactive$.completions$$anonfun$2(Interactive.scala:91)
        at scala.compat.java8.JProcedure2.apply(JProcedure2.java:18)
        at scala.compat.java8.JProcedure2.apply(JProcedure2.java:10)
        at dotty.tools.dotc.core.Types$Type.memberDenots$$anonfun$1(Types.scala:673)
        at scala.compat.java8.JProcedure1.apply(JProcedure1.java:18)
        at scala.compat.java8.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:316)
        at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:972)
        at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:972)
        at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:972)
        at dotty.tools.dotc.core.Types$Type.memberDenots(Types.scala:673)
        at dotty.tools.dotc.interactive.Interactive$.completions(Interactive.scala:92)
        at dotty.tools.dotc.interactive.Interactive$.completions$$anonfun$1(Interactive.scala:73)
        at scala.collection.immutable.List.flatMap(List.scala:338)
        at dotty.tools.dotc.interactive.Interactive$.completions(Interactive.scala:84)
        at dotty.tools.languageserver.DottyLanguageServer.completion$$anonfun$1(DottyLanguageServer.scala:203)
        at dotty.tools.languageserver.DottyLanguageServer.liftedTree1$1(DottyLanguageServer.scala:108)
        at dotty.tools.languageserver.DottyLanguageServer.computeAsync$$anonfun$1(DottyLanguageServer.scala:113)
        at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
        at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
        at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
@smarter
Copy link
Member Author

smarter commented Jul 4, 2017

I'm on it, this seems to be related to scala/scala#5952

smarter added a commit to dotty-staging/dotty that referenced this issue Jul 5, 2017
This is similar to scala/scala#5952, we do not
need to parse artifact classfiles (that is, classfiles produced by
scalac or dotty that do not contain pickling information), so we discard
them as soon as possible.
This fixes various IDE crashes when trying to complete packages such as
"scala."
smarter added a commit to dotty-staging/dotty that referenced this issue Jul 5, 2017
This is similar to scala/scala#5952, we do not
need to parse artifact classfiles (that is, classfiles produced by
scalac or dotty that do not contain pickling information), so we discard
them as soon as possible.
This fixes various IDE crashes when trying to complete packages such as
"scala."
smarter added a commit to dotty-staging/dotty that referenced this issue Jul 5, 2017
This is similar to scala/scala#5952, we do not
need to parse artifact classfiles (that is, classfiles produced by
scalac or dotty that do not contain pickling information), so we discard
them as soon as possible.
This fixes various IDE crashes when trying to complete packages such as
"scala."
smarter added a commit to dotty-staging/dotty that referenced this issue Jul 5, 2017
This is similar to scala/scala#5952, we do not
need to parse artifact classfiles (that is, classfiles produced by
scalac or dotty that do not contain pickling information), so we discard
them as soon as possible.
This fixes various IDE crashes when trying to complete packages such as
"scala."
smarter added a commit to dotty-staging/dotty that referenced this issue Jul 6, 2017
This is similar to scala/scala#5952, we do not
need to parse artifact classfiles (that is, classfiles produced by
scalac or dotty that do not contain pickling information), so we discard
them as soon as possible.
This fixes various IDE crashes when trying to complete packages such as
"scala."
smarter added a commit to dotty-staging/dotty that referenced this issue Jul 11, 2017
This is similar to scala/scala#5952, we do not
need to parse artifact classfiles (that is, classfiles produced by
scalac or dotty that do not contain pickling information), so we discard
them as soon as possible.
This fixes various IDE crashes when trying to complete packages such as
"scala."
smarter added a commit that referenced this issue Jul 11, 2017
Fix #2809: Invalidate and unlink symbols for artifact classfiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant