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

scaladoc crashes on extension methods involving tuples #19925

Closed
natsukagami opened this issue Mar 12, 2024 · 0 comments · Fixed by #20467
Closed

scaladoc crashes on extension methods involving tuples #19925

natsukagami opened this issue Mar 12, 2024 · 0 comments · Fixed by #20467

Comments

@natsukagami
Copy link
Contributor

Compiler version

3.3.1 and latest main (3694d95)

Minimized code

case class Wrap[+T](x: T)

extension[T](a: T)
  /** Tuplify */
  def *:[U <: Tuple](b: Wrap[U]): Wrap[T *: U] = Wrap(a *: b.x)

Expectation

Running scala-cli doc on this file crashes with

Problem parsing test.scala:<40..166>, documentation may not be generated.

printing the stack trace in TastyParser gives

java.lang.AssertionError: assertion failed: croppedUnshuffledMemberInfoParamLists and SymOps.nonExtensionParamLists disagree on whether this clause is a type or term one
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.$anonfun$22(ClassLikeSupport.scala:389)
	at scala.collection.immutable.List.flatMap(List.scala:293)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.parseMethod(ClassLikeSupport.scala:390)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.parseMethod$(ClassLikeSupport.scala:18)
	at dotty.tools.scaladoc.tasty.TastyParser.parseMethod(TastyParser.scala:178)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.parseMember$$anonfun$1$$anonfun$1(ClassLikeSupport.scala:171)
	at scala.Option.map(Option.scala:242)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.parseMember$$anonfun$1(ClassLikeSupport.scala:171)
	at dotty.tools.scaladoc.tasty.TastyParser.processTreeOpt(TastyParser.scala:213)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.parseMember(ClassLikeSupport.scala:206)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.extractMembers$$anonfun$1(ClassLikeSupport.scala:241)
	at scala.collection.immutable.List.flatMap(List.scala:293)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.extractMembers(ClassLikeSupport.scala:241)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.extractMembers$(ClassLikeSupport.scala:18)
	at dotty.tools.scaladoc.tasty.TastyParser.extractMembers(TastyParser.scala:178)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.extractPatchedMembers(ClassLikeSupport.scala:247)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.extractPatchedMembers$(ClassLikeSupport.scala:18)
	at dotty.tools.scaladoc.tasty.TastyParser.extractPatchedMembers(TastyParser.scala:178)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.mkClass(ClassLikeSupport.scala:133)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.mkClass$(ClassLikeSupport.scala:18)
	at dotty.tools.scaladoc.tasty.TastyParser.mkClass(TastyParser.scala:178)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.parseObject(ClassLikeSupport.scala:317)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.parseObject$(ClassLikeSupport.scala:18)
	at dotty.tools.scaladoc.tasty.TastyParser.parseObject(TastyParser.scala:178)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.parseClasslike(ClassLikeSupport.scala:310)
	at dotty.tools.scaladoc.tasty.ClassLikeSupport.parseClasslike$(ClassLikeSupport.scala:18)
	at dotty.tools.scaladoc.tasty.TastyParser.parseClasslike(TastyParser.scala:178)
	at dotty.tools.scaladoc.tasty.PackageSupport.parsePackageObject(PackageSupport.scala:19)
	at dotty.tools.scaladoc.tasty.PackageSupport.parsePackageObject$(PackageSupport.scala:8)
	at dotty.tools.scaladoc.tasty.TastyParser.parsePackageObject(TastyParser.scala:178)
	at dotty.tools.scaladoc.tasty.TastyParser$Traverser$2$.traverseTree(TastyParser.scala:230)
	at scala.quoted.Quotes$reflectModule$TreeTraverser.foldTree(Quotes.scala:4902)
	at scala.quoted.Quotes$reflectModule$TreeTraverser.foldTree$(Quotes.scala:4898)
	at dotty.tools.scaladoc.tasty.TastyParser$Traverser$2$.foldTree(TastyParser.scala:220)
	at dotty.tools.scaladoc.tasty.TastyParser$Traverser$2$.foldTree(TastyParser.scala:220)
	at scala.quoted.Quotes$reflectModule$TreeAccumulator.foldTrees$$anonfun$1(Quotes.scala:4790)
	at scala.collection.LinearSeqOps.foldLeft(LinearSeq.scala:183)
	at scala.collection.LinearSeqOps.foldLeft$(LinearSeq.scala:179)
	at scala.collection.immutable.List.foldLeft(List.scala:79)
	at scala.quoted.Quotes$reflectModule$TreeAccumulator.foldTrees(Quotes.scala:4790)
	at scala.quoted.Quotes$reflectModule$TreeAccumulator.foldTrees$(Quotes.scala:4785)
	at dotty.tools.scaladoc.tasty.TastyParser$Traverser$2$.foldTrees(TastyParser.scala:220)
	at scala.quoted.Quotes$reflectModule$TreeAccumulator.foldOverTree(Quotes.scala:4853)
	at scala.quoted.Quotes$reflectModule$TreeAccumulator.foldOverTree$(Quotes.scala:4785)
	at dotty.tools.scaladoc.tasty.TastyParser$Traverser$2$.foldOverTree(TastyParser.scala:220)
	at scala.quoted.Quotes$reflectModule$TreeTraverser.traverseTreeChildren(Quotes.scala:4904)
	at scala.quoted.Quotes$reflectModule$TreeTraverser.traverseTreeChildren$(Quotes.scala:4898)
	at dotty.tools.scaladoc.tasty.TastyParser$Traverser$2$.traverseTreeChildren(TastyParser.scala:220)
	at scala.quoted.Quotes$reflectModule$TreeTraverser.traverseTree(Quotes.scala:4900)
	at scala.quoted.Quotes$reflectModule$TreeTraverser.traverseTree$(Quotes.scala:4898)
	at dotty.tools.scaladoc.tasty.TastyParser$Traverser$2$.traverseTree(TastyParser.scala:228)
	at dotty.tools.scaladoc.tasty.TastyParser.parseRootTree(TastyParser.scala:237)
	at dotty.tools.scaladoc.tasty.ScaladocTastyInspector.inspect$$anonfun$2(TastyParser.scala:112)
	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.scaladoc.tasty.ScaladocTastyInspector.inspect(TastyParser.scala:113)
	at scala.tasty.inspector.TastyInspector$TastyInspectorPhase$1.runOnImpl(TastyInspector.scala:82)
	at scala.tasty.inspector.TastyInspector$TastyInspectorPhase$1.runOn(TastyInspector.scala:74)
	at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:315)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
	at dotty.tools.dotc.Run.runPhases$1(Run.scala:337)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:350)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:360)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:69)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:360)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:267)
	at dotty.tools.dotc.fromtasty.TASTYRun.compile(TASTYRun.scala:15)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:37)
	at dotty.tools.dotc.Driver.process(Driver.scala:196)
	at dotty.tools.dotc.Driver.process(Driver.scala:164)
	at dotty.tools.dotc.Driver.process(Driver.scala:176)
	at scala.tasty.inspector.TastyInspector$.inspectFiles(TastyInspector.scala:121)
	at scala.tasty.inspector.TastyInspector$.inspectAllTastyFiles(TastyInspector.scala:62)
	at dotty.tools.scaladoc.tasty.ScaladocTastyInspector$.loadDocs(TastyParser.scala:163)
	at dotty.tools.scaladoc.ScalaModuleProvider$.mkModule(ScalaModuleProvider.scala:11)
	at dotty.tools.scaladoc.Scaladoc$.run(Scaladoc.scala:240)
	at dotty.tools.scaladoc.Scaladoc$.run$$anonfun$1(Scaladoc.scala:70)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.Option.map(Option.scala:242)
	at dotty.tools.scaladoc.Scaladoc$.run(Scaladoc.scala:74)
	at dotty.tools.scaladoc.Main.run(Main.scala:8)
	at dotty.tools.scaladoc.Main$.main(Main.scala:14)
	at dotty.tools.scaladoc.Main.main(Main.scala)
@natsukagami natsukagami added itype:bug area:doctool stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 12, 2024
@Gedochao Gedochao added itype:crash and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 12, 2024
natsukagami added a commit to natsukagami/async that referenced this issue Mar 12, 2024
Also temporarily remove `*:` tuple comparison due to a scaladoc crash, see scala/scala3#19925
natsukagami added a commit to natsukagami/async that referenced this issue Mar 12, 2024
Also temporarily remove `*:` tuple comparison due to a scaladoc crash, see scala/scala3#19925
natsukagami added a commit to lampepfl/gears that referenced this issue Mar 14, 2024
* Add more documentation to Async
* Also temporarily remove `*:` tuple comparison due to a scaladoc crash, see scala/scala3#19925
Florian3k added a commit that referenced this issue May 28, 2024
…nd printers (#20467)

Fixes #19925 
The same issue with handling right associative extension methods was
also present in RefinedPrinter and ShortenedTypePrinter, so I fixed
those as well
@Kordyjan Kordyjan added this to the 3.5.1 milestone Jul 3, 2024
WojciechMazur added a commit that referenced this issue Jul 8, 2024
…nd printers (#20467)

Fixes #19925 
The same issue with handling right associative extension methods was
also present in RefinedPrinter and ShortenedTypePrinter, so I fixed
those as well
[Cherry-picked d3df8ca][modified]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants