-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
REPL regression with instantiating class instances from the scala.concurrent.duration
package
#16322
Comments
…20734 - The lines that instantiate classes from scala.concurrent.duration have been removed due to scala/scala3#16322. A test will be added for that specifically. - The presentation of some methods has been changed in the platform, to show a `:` instead of `=>`.
…20734 - The lines that instantiate classes from scala.concurrent.duration have been removed due to scala/scala3#16322. A test will be added for that specifically. - The presentation of some methods has been changed in the platform, to show a `:` instead of `=>`.
Note that the problem isn't in the instantiation itself:
but in the REPL code for type-driven printing of values (as obvious anyway in the stack trace: It seems from #16387 that the package-object angle isn't relevant; it's a value-class thing. But maybe it's relevant that neither value-class is top level. Dale has a suspect: #15545 . But it does have a test of an inner value class, so why are these failure cases different? |
Ah, it's because you need a I think this is the minimal reproducer: package p
class D(val n: Int) extends AnyVal and then in the REPL, (We should still also include a test that has an inner class and a package, though, since we're slinging JVM-level class names and inner classes is an easy area for that to go wrong.) |
Compiler version
3.2.1
Minimized code
Open a Scala 3.2.1 REPL:
Output
Same error happens if
new
is not used.Expectation
Scala 3.2.0 REPL:
Output:
Although, the result is also weird, there's a mention of
scala.concurrent.duration.package.DurationInt
, which is not the same fully qualified name. As far as I can tell, this behavior is consistent in Scala 3.1.3 too. I did not check older versions.Edit:
Scala 2.13.10 reports the same value as:
The mention of
package
might just be down to the bytecode encoding and might be completely fine.The text was updated successfully, but these errors were encountered: