-
Notifications
You must be signed in to change notification settings - Fork 231
Fix issue with not recognizing dialects in post-3.4.0 versions of Scala #4241
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
Conversation
a9aeb38
to
50a3bbb
Compare
50a3bbb
to
0ad565a
Compare
It looks like implicit vals in scala 3.3.x are unpickled into a methods, and in later version they are unpickled into vals. To confirm that the imported dialect can be found in the proper package, we now just check whether it's a declaration there, regardless of it being a method or a val.
0ad565a
to
19b21a2
Compare
in that case, I'd start by adding a newer scala version into the build, then a test that fails, then a fix showing that the test becomes successful. |
Let me add that separately. |
Ok, so if you switch to version 3.7.0 things don't even compile without this change. So instead I added Scala 3.7.0 to tests and run it as an additional case. Though there is some weirdness around sbt here, so might need to dig in a bit more |
56ddb28
to
7a0cfb8
Compare
Ok, tests seems to work. Without @jchyb fix it wouldn't actually even compile the tests |
@@ -517,7 +518,8 @@ lazy val sharedSettings = Def.settings( | |||
else List(compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full)) | |||
}, | |||
scalacOptions ++= { if (isScala213.value) List("-Ymacro-annotations") else Nil }, | |||
scalacOptions ++= { if (isScala213or3.value) List("-Xfatal-warnings") else Nil }, | |||
scalacOptions ++= | |||
{ if (isScala213or3.value && !isScala3Next.value) List("-Xfatal-warnings") else Nil }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a bunch of migration warnings, that we don't want to change yet
is this not something that could be tested, explicitly, first with |
We need to compile it with Scala 3.7.0 and it doesn't compile without the fix so there is not way to add the tests first unfortunately. |
It looks like implicit vals in scala 3.3.x are unpickled into a methods, and in later versions they are unpickled into vals. To confirm that the imported dialect can be found in the proper package, we now just check whether it's a declaration there, regardless of it being a method or a val.
I did not add any regression tests here, as the problem appeared only in the scala versions not used in the build, so they would be ineffective here.