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

explicit unapplySeq call in REPL throw ClassNotFoundException: SeqFactory$UnapplySeqWrapper #16387

Closed
xuwei-k opened this issue Nov 20, 2022 · 3 comments · Fixed by #16393
Closed
Assignees
Labels
area:repl itype:bug itype:crash regression This worked in a previous version but doesn't anymore
Milestone

Comments

@xuwei-k
Copy link
Contributor

xuwei-k commented Nov 20, 2022

Compiler version

  • 3.2.1
  • 3.3.0-RC1-bin-20221119-786ad3f-NIGHTLY

Minimized code

Vector.unapplySeq(Vector(2))

Output

Welcome to Scala 3.3.0-RC1-bin-20221119-786ad3f-NIGHTLY-git-786ad3f (11.0.17, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                                                               
scala> Vector.unapplySeq(Vector(2))
[error] java.lang.ClassNotFoundException: SeqFactory$UnapplySeqWrapper
[error] 	at dotty.tools.repl.AbstractFileClassLoader.findClass(AbstractFileClassLoader.scala:51)
[error] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
[error] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
[error] 	at dotty.tools.repl.AbstractFileClassLoader.loadClass(AbstractFileClassLoader.scala:57)
[error] 	at java.base/java.lang.Class.forName0(Native Method)
[error] 	at java.base/java.lang.Class.forName(Class.java:398)
[error] 	at dotty.tools.repl.Rendering.rewrapValueClass(Rendering.scala:135)
[error] 	at dotty.tools.repl.Rendering.$anonfun$4(Rendering.scala:114)
[error] 	at scala.Option.flatMap(Option.scala:283)
[error] 	at dotty.tools.repl.Rendering.valueOf(Rendering.scala:114)
[error] 	at dotty.tools.repl.Rendering.renderVal(Rendering.scala:157)
[error] 	at dotty.tools.repl.ReplDriver.$anonfun$7(ReplDriver.scala:372)
[error] 	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
[error] 	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
[error] 	at scala.collection.immutable.List.foreach(List.scala:333)
[error] 	at dotty.tools.repl.ReplDriver.extractAndFormatMembers$1(ReplDriver.scala:378)
[error] 	at dotty.tools.repl.ReplDriver.renderDefinitions$$anonfun$2(ReplDriver.scala:410)
[error] 	at scala.Option.map(Option.scala:242)
[error] 	at dotty.tools.repl.ReplDriver.renderDefinitions(ReplDriver.scala:416)
[error] 	at dotty.tools.repl.ReplDriver.compile$$anonfun$2(ReplDriver.scala:312)
[error] 	at scala.util.Either.fold(Either.scala:189)
[error] 	at dotty.tools.repl.ReplDriver.compile(ReplDriver.scala:330)
[error] 	at dotty.tools.repl.ReplDriver.interpret(ReplDriver.scala:253)
[error] 	at dotty.tools.repl.ReplDriver.loop$1(ReplDriver.scala:168)
[error] 	at dotty.tools.repl.ReplDriver.runUntilQuit$$anonfun$1(ReplDriver.scala:171)
[error] 	at dotty.tools.repl.ReplDriver.withRedirectedOutput(ReplDriver.scala:196)
[error] 	at dotty.tools.repl.ReplDriver.runBody$$anonfun$1(ReplDriver.scala:184)
[error] 	at dotty.tools.runner.ScalaClassLoader$.asContext(ScalaClassLoader.scala:80)
[error] 	at dotty.tools.repl.ReplDriver.runBody(ReplDriver.scala:184)
[error] 	at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:171)
[error] 	at xsbt.ConsoleInterface.run(ConsoleInterface.java:52)
[error] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Expectation

don't throw error

@xuwei-k xuwei-k added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 20, 2022
@xuwei-k
Copy link
Contributor Author

xuwei-k commented Nov 20, 2022

note: no error Scala 3.2.0, 3.1.3 and 3.0.2

Welcome to Scala 3.1.3 (11.0.17, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                                                               
scala> Vector.unapplySeq(Vector(2))
val res0: scala.collection.SeqFactory.UnapplySeqWrapper[Int] = Vector(2)

@prolativ prolativ added area:repl itype:crash regression This worked in a previous version but doesn't anymore and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 21, 2022
@dwijnand
Copy link
Member

This might be the same cause as #16322, which I'm looking at next.

@SethTisue
Copy link
Member

SethTisue commented Nov 22, 2022

yeah, duplicate of #16322

@SethTisue SethTisue closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2022
smarter added a commit that referenced this issue Dec 9, 2022
By fixing `Rendering`'s `rewrapValueClass` to use the fully qualified
class name

Sequel to #15545

Fixes #16322
Fixes #16387
@Kordyjan Kordyjan added this to the 3.3.0 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:repl itype:bug itype:crash regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants