Skip to content

-release 8 causes java.time.Instant to have a fictitious constructor #12565

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

Closed
Jasper-M opened this issue Mar 25, 2022 · 7 comments · Fixed by scala/scala#9981
Closed

-release 8 causes java.time.Instant to have a fictitious constructor #12565

Jasper-M opened this issue Mar 25, 2022 · 7 comments · Fixed by scala/scala#9981
Assignees
Milestone

Comments

@Jasper-M
Copy link

Jasper-M commented Mar 25, 2022

Reproduction steps

scalaVersion := "2.13.8"

scalacOptions ++= List("-release", "8")
Welcome to Scala 2.13.8 (OpenJDK 64-Bit Server VM, Java 11.0.14).
Type in expressions for evaluation. Or try :help.

scala> new java.time.Instant
java.lang.NoSuchMethodError: java.time.Instant: method 'void <init>()' not found
  ... 35 elided

Problem

java.time.Instant doesn't have a default constructor but the compiler seems to think that it does.

@som-snytt
Copy link

This is for any earlier release, using ct.sym. (8 is sometimes a special version number. "Lucky 8".)

@som-snytt
Copy link

The condition for adding a ctor in ClassFileParser needs a couple of tweaks.

@som-snytt
Copy link

For some reason, there is no label for JDK 8.

@Jasper-M
Copy link
Author

Are backports to 2.12 for stuff like this still accepted or are they frowned upon?

@som-snytt
Copy link

@Jasper-M I think they just throw you "side eye".

@SethTisue
Copy link
Member

thanks @Jasper-M for the great catch and bug report, and thanks @som-snytt for the fix 🚀

@smarter
Copy link
Member

smarter commented May 9, 2022

Same bug in Scala 3: scala/scala3#15144

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