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

Test support for stubs compiled with Scala 3 & publish codegen for Scala 3 #123

Closed
wants to merge 4 commits into from

Conversation

bjaglin
Copy link
Contributor

@bjaglin bjaglin commented Jun 28, 2021

No description provided.

@@ -1,6 +1,6 @@
addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.4")

libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.1"
libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.4"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test updates
* refined uses macro that are not available in Scala 3
* type of implicit definition needs to be given explicitly
* customize "implicit not found" error message
@@ -32,7 +32,7 @@ inThisBuild(

val pgvVersion = "0.4.1"
val munitSettings = Seq(
libraryDependencies += "org.scalameta" %% "munit" % "0.7.25" % Test,
libraryDependencies += "org.scalameta" %% "munit" % "0.7.26" % Test,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +100 to +101
// avoids "Not found: type UnusedPrivateParameter" in scalapb/scalapb/validate/Validate.java with Scala 3
Compile / compileOrder := CompileOrder.JavaThenScala
Copy link
Contributor Author

@bjaglin bjaglin Jun 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like bug in dotty. Without this:

[info] compiling 19 Scala sources and 3 Java sources to /home/bjaglin/git/projects/scalapb-validate/code-gen/target/jvm-3/classes ...
[error] -- [E006] Not Found Error: /home/bjaglin/git/projects/scalapb-validate/code-gen/target/jvm-3/src_managed/main/scalapb/scalapb/validate/Validate.java:152:8 
[error] 152 |        UnusedPrivateParameter unused) {
[error]     |        ^^^^^^^^^^^^^^^^^^^^^^
[error]     |        Not found: type UnusedPrivateParameter
[error] -- [E006] Not Found Error: /home/bjaglin/git/projects/scalapb-validate/code-gen/target/jvm-3/src_managed/main/scalapb/scalapb/validate/Validate.java:1209:8 
[error] 1209 |        UnusedPrivateParameter unused) {
[error]      |        ^^^^^^^^^^^^^^^^^^^^^^
[error]      |        Not found: type UnusedPrivateParameter
[error] -- [E006] Not Found Error: /home/bjaglin/git/projects/scalapb-validate/code-gen/target/jvm-3/src_managed/main/scalapb/scalapb/validate/Validate.java:1834:8 
[error] 1834 |        UnusedPrivateParameter unused) {
[error]      |        ^^^^^^^^^^^^^^^^^^^^^^
[error]      |        Not found: type UnusedPrivateParameter
[error] -- [E006] Not Found Error: /home/bjaglin/git/projects/scalapb-validate/code-gen/target/jvm-3/src_managed/main/scalapb/scalapb/validate/Validate.java:2386:8 
[error] 2386 |        UnusedPrivateParameter unused) {
[error]      |        ^^^^^^^^^^^^^^^^^^^^^^
[error]      |        Not found: type UnusedPrivateParameter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this static inner class is a recurring source of problems scala/bug#9111 (comment)

Copy link
Contributor Author

@bjaglin bjaglin Jun 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like ScalaPB went this way as well to workaround the issue scalapb/ScalaPB@c4f9ce9#diff-dd3701b993fcc974a9a6d017159aac00d4b41bcd05ad319815c6001311c669d5R66

@bjaglin bjaglin changed the title Scala 3 support Test support for stubs compiled with Scala 3 & publish codegen for Scala 3 Jun 28, 2021
@thesamet
Copy link
Contributor

Thanks, this got in via 03da6a7

@thesamet thesamet closed this Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants