-
Notifications
You must be signed in to change notification settings - Fork 21
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
runtime NoClassDefFoundError
occurs on Scala 3.0.0, but not Scala 2.12, 2.13
#12396
Comments
Duplicate of scala/scala3#12249. |
I don't think it's a duplicate, scala/scala3#12249 is about using the new |
@smarter as an aside, it would be nice to get lampepfl/dotty relocated to scala/* before toooooo much longer, one reason being so GitHub would let us transfer issues between there and scala/bug |
@SethTisue agreed, but definitely not something I want to tackle myself :). |
forward-port of scala/scala#10675 and scala/scala#8595 references scala/bug#12396 and scala/bug#11635 fixes #19527 ("bad constant pool tag 17") also fixes unreported potential "bad constant pool tag 19" and "bad constant pool tag 20" errors
reproduction steps
Code for this issue can be found in https://github.com/rtyley/scala-2-vs-3-NoClassDefFoundError, relatively stripped down from where I actually encountered the issue when upgrading a library to Scala 3.0.0. The runtime error occurs when executing this code:
When executing
sbt test
on the code, I get ajava.lang.NoClassDefFoundError
under Scala 3.0.0, but not under Scala 2.13.5 or 2.12.13. There is a Travis CI build to verify this:The error given in
sbt
(an error report added to sbt with sbt/sbt#4602) suggests using a differentClassLoaderLayeringStrategy
, however none of the available strategy settings (AllLibraryJars
,Flat
,ScalaLibrary
) allow Scala 3.0.0 to succeed.Scala 3.0.0 does pass if the code is modified in either of these ways:
getClass
(originally used to load test resources in the library where this issue was found) is removed.package object
to a normalobject
.problem
I would expect the code compiled under Scala 3.0.0 to work just as well as Scala 2.12 or 2.13, without throwing a
NoClassDefFoundError
!The text was updated successfully, but these errors were encountered: