Skip to content

ClassDefSymbolAPI#methods can sometimes explode on polymorphic classes #6516

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
abgruszecki opened this issue May 15, 2019 · 1 comment
Closed
Assignees

Comments

@abgruszecki
Copy link
Contributor

As in the title.

Reproduction: #6515

Error:

Caused by: dotty.tools.dotc.core.TypeError: bad parameter reference notscala.collection.immutable.List#A at tastyConsumer                                                                                                                                                                 
the parameter is type A in class List but the prefix notscala.collection.immutable.List                                                                                                                                                                                                   
does not define any corresponding arguments.  

This is most likely caused by performing some operation on List and not List[X].

Full stack trace

NoExplanation(bad parameter reference notscala.collection.immutable.List#A at tastyConsumer
the parameter is type A in class List but the prefix notscala.collection.immutable.List
does not define any corresponding arguments.) while compiling notscala.collection.immutable.List
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at dotty.tools.vulpix.ChildJVMMain.runMain(ChildJVMMain.java:40)
        at dotty.tools.vulpix.ChildJVMMain.main(ChildJVMMain.java:47)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at scala.tasty.file.ConsumeTasty$.apply(ConsumeTasty.scala:16)
        at Test$.main(Test.scala:6)
        at Test.main(Test.scala)
        ... 6 more
Caused by: dotty.tools.dotc.core.TypeError: bad parameter reference notscala.collection.immutable.List#A at tastyConsumer
the parameter is type A in class List but the prefix notscala.collection.immutable.List
does not define any corresponding arguments.
        at dotty.tools.dotc.core.Types$NamedType.argDenot(Types.scala:1985)
        at dotty.tools.dotc.core.Types$NamedType.fromDesignator$1(Types.scala:1900)
        at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:1918)
        at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:1874)
        at dotty.tools.dotc.core.Types$NamedType.info(Types.scala:1863)
        at dotty.tools.dotc.core.Types$$anon$5.apply(Types.scala:3103)
        at dotty.tools.dotc.core.Types$$anon$5.apply(Types.scala:3096)
        at dotty.tools.dotc.core.Types$TypeAccumulator.foldArgs$1(Types.scala:4915)
        at dotty.tools.dotc.core.Types$TypeAccumulator.foldOver(Types.scala:4919)
        at dotty.tools.dotc.core.Types$$anon$5.apply(Types.scala:3110)
        at dotty.tools.dotc.core.Types$$anon$5.apply(Types.scala:3096)
        at dotty.tools.dotc.core.Types$TypeAccumulator.foldOver(Types.scala:4995)
        at dotty.tools.dotc.core.Types$TypeAccumulator.foldOver(Types.scala:4927)
        at dotty.tools.dotc.core.Types$$anon$5.apply(Types.scala:3110)
        at dotty.tools.dotc.core.Types$$anon$5.apply(Types.scala:3096)
        at dotty.tools.dotc.core.Types$TermLambda.dotty$tools$dotc$core$Types$TermLambda$$depStatus(Types.scala:3113)
        at dotty.tools.dotc.core.Types$TermLambda.dependencyStatus(Types.scala:3127)
        at dotty.tools.dotc.core.Types$TermLambda.resultType(Types.scala:3070)
        at dotty.tools.dotc.core.Types$MethodType.resultType(Types.scala:3174)
        at dotty.tools.dotc.core.Types$TypeMap.mapOverLambda$1(Types.scala:4535)
        at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:4542)
        at dotty.tools.dotc.core.Substituters.subst(Substituters.scala:21)
        at dotty.tools.dotc.core.Contexts$Context.subst(Contexts.scala:71)
        at dotty.tools.dotc.core.Types$Type.subst(Types.scala:1466)
        at dotty.tools.dotc.core.Types$LambdaType.newLikeThis$$anonfun$2(Types.scala:3011)
        at dotty.tools.dotc.core.Types$PolyType.<init>(Types.scala:3384)
        at dotty.tools.dotc.core.Types$PolyType$.apply(Types.scala:3456)
        at dotty.tools.dotc.core.Types$PolyType$.apply(Types.scala:3453)
        at dotty.tools.dotc.core.Types$LambdaType.newLikeThis(Types.scala:3011)
        at dotty.tools.dotc.core.Types$MethodOrPoly.newLikeThis(Types.scala:3042)
        at dotty.tools.dotc.core.Types$LambdaType.derivedLambdaType(Types.scala:3006)
        at dotty.tools.dotc.core.Types$MethodOrPoly.derivedLambdaType(Types.scala:3042)
        at dotty.tools.dotc.core.Types$ApproximatingTypeMap.derivedLambdaType(Types.scala:4866)
        at dotty.tools.dotc.core.Types$TypeMap.mapOverLambda$1(Types.scala:4540)
        at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:4542)
        at dotty.tools.dotc.core.TypeOps$AsSeenFromMap.apply(TypeOps.scala:105)
        at dotty.tools.dotc.core.TypeOps.asSeenFrom(TypeOps.scala:51)
        at dotty.tools.dotc.core.Contexts$Context.asSeenFrom(Contexts.scala:71)
        at dotty.tools.dotc.core.Types$Type.asSeenFrom(Types.scala:832)
        at dotty.tools.dotc.core.Denotations$SingleDenotation.computeAsSeenFrom(Denotations.scala:1118)
        at dotty.tools.dotc.core.Denotations$SingleDenotation.computeAsSeenFrom(Denotations.scala:1111)
        at dotty.tools.dotc.core.Denotations$PreDenotation.asSeenFrom(Denotations.scala:128)
        at dotty.tools.dotc.core.SymDenotations$ClassDenotation.findMember(SymDenotations.scala:1736)
        at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:562)
        at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:712)
        at dotty.tools.dotc.core.Types$Type.memberBasedOnFlags(Types.scala:545)
        at dotty.tools.dotc.core.Types$Type.member(Types.scala:530)
        at dotty.tools.dotc.core.Types$Type.allMembers$$anonfun$1(Types.scala:820)
        at dotty.runtime.function.JProcedure2.apply(JProcedure2.java:15)
        at dotty.runtime.function.JProcedure2.apply(JProcedure2.java:10)
        at dotty.tools.dotc.core.Types$Type.memberDenots$$anonfun$1(Types.scala:757)
        at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:321)
        at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:977)
        at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:977)
        at dotty.tools.dotc.core.Types$Type.memberDenots(Types.scala:757)
        at dotty.tools.dotc.core.Types$Type.allMembers(Types.scala:820)
        at dotty.tools.dotc.tastyreflect.KernelImpl.ClassDefSymbol_methods(KernelImpl.scala:1559)
        at dotty.tools.dotc.tastyreflect.KernelImpl.ClassDefSymbol_methods(KernelImpl.scala:1558)
        at scala.tasty.reflect.SymbolOps$ClassDefSymbolAPI.methods(SymbolOps.scala:149)
        at DBConsumer$Traverser$1$.traverseTree(Test.scala:18)
        at scala.tasty.reflect.TreeUtils$TreeTraverser.foldTree(TreeUtils.scala:115)
        at scala.tasty.reflect.TreeUtils$TreeTraverser.foldTree(TreeUtils.scala:115)
        at scala.tasty.reflect.TreeUtils$TreeAccumulator.foldTrees$$anonfun$1(TreeUtils.scala:17)
        at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
        at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
        at scala.collection.immutable.List.foldLeft(List.scala:89)
        at scala.collection.TraversableOnce.$div$colon(TraversableOnce.scala:154)
        at scala.collection.TraversableOnce.$div$colon$(TraversableOnce.scala:154)
        at scala.collection.AbstractTraversable.$div$colon(Traversable.scala:108)
        at scala.tasty.reflect.TreeUtils$TreeAccumulator.foldTrees(TreeUtils.scala:17)
        at scala.tasty.reflect.TreeUtils$TreeAccumulator.foldOverTree(TreeUtils.scala:77)
        at scala.tasty.reflect.TreeUtils$TreeTraverser.traverseTreeChildren(TreeUtils.scala:118)
        at scala.tasty.reflect.TreeUtils$TreeTraverser.traverseTree(TreeUtils.scala:112)
        at DBConsumer$Traverser$1$.traverseTree(Test.scala:21)
        at scala.tasty.reflect.TreeUtils$TreeTraverser.foldTree(TreeUtils.scala:115)
        at scala.tasty.reflect.TreeUtils$TreeTraverser.foldTree(TreeUtils.scala:115)
        at scala.tasty.reflect.TreeUtils$TreeAccumulator.foldTrees$$anonfun$1(TreeUtils.scala:17)
        at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
        at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
        at scala.collection.immutable.List.foldLeft(List.scala:89)
        at scala.collection.TraversableOnce.$div$colon(TraversableOnce.scala:154)
        at scala.collection.TraversableOnce.$div$colon$(TraversableOnce.scala:154)
        at scala.collection.AbstractTraversable.$div$colon(Traversable.scala:108)
        at scala.tasty.reflect.TreeUtils$TreeAccumulator.foldTrees(TreeUtils.scala:17)
        at scala.tasty.reflect.TreeUtils$TreeAccumulator.foldOverTree(TreeUtils.scala:77)
        at scala.tasty.reflect.TreeUtils$TreeTraverser.traverseTreeChildren(TreeUtils.scala:118)
        at scala.tasty.reflect.TreeUtils$TreeTraverser.traverseTree(TreeUtils.scala:112)
        at DBConsumer$Traverser$1$.traverseTree(Test.scala:21)
        at scala.tasty.reflect.TreeUtils$TreeTraverser.foldTree(TreeUtils.scala:115)
        at scala.tasty.reflect.TreeUtils$TreeTraverser.foldTree(TreeUtils.scala:115)
        at scala.tasty.reflect.TreeUtils$TreeAccumulator.foldTrees$$anonfun$1(TreeUtils.scala:17)
        at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
        at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
        at scala.collection.immutable.List.foldLeft(List.scala:89)
        at scala.collection.TraversableOnce.$div$colon(TraversableOnce.scala:154)
        at scala.collection.TraversableOnce.$div$colon$(TraversableOnce.scala:154)
        at scala.collection.AbstractTraversable.$div$colon(Traversable.scala:108)
        at scala.tasty.reflect.TreeUtils$TreeAccumulator.foldTrees(TreeUtils.scala:17)
        at scala.tasty.reflect.TreeUtils$TreeAccumulator.foldOverTree(TreeUtils.scala:77)
        at scala.tasty.reflect.TreeUtils$TreeTraverser.traverseTreeChildren(TreeUtils.scala:118)
        at scala.tasty.reflect.TreeUtils$TreeTraverser.traverseTree(TreeUtils.scala:112)
        at DBConsumer$Traverser$1$.traverseTree(Test.scala:21)
        at DBConsumer.apply(Test.scala:25)
        at dotty.tools.dotc.consumetasty.TastyConsumerPhase.run(TastyConsumerPhase.scala:15)
        at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:316)
        at scala.collection.immutable.List.map(List.scala:286)
        at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:318)
        at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:158)
        at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
        at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)
        at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:198)
        at dotty.tools.dotc.Run.runPhases$5(Run.scala:170)
        at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:178)
        at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
        at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:102)
        at dotty.tools.dotc.Run.compileUnits(Run.scala:185)
        at dotty.tools.dotc.Run.compileUnits(Run.scala:125)
        at dotty.tools.dotc.fromtasty.TASTYRun.compile(TASTYRun.scala:10)
        at dotty.tools.dotc.Driver.doCompile(Driver.scala:34)
        at dotty.tools.dotc.Driver.process(Driver.scala:172)
        at dotty.tools.dotc.Driver.process(Driver.scala:141)
        at dotty.tools.dotc.Driver.process(Driver.scala:153)
        at dotty.tools.dotc.consumetasty.ConsumeTasty$.apply(ConsumeTasty.scala:22)
        at dotty.tools.dotc.consumetasty.ConsumeTasty.apply(ConsumeTasty.scala)
        ... 13 more

@abgruszecki
Copy link
Contributor Author

Was fixed in #6521, closing.

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

2 participants