- Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Compiler version
Latest nightly:
scalaVersion := "3.0.0-RC2-bin-20210320-0195dff-NIGHTLY" Minimized code
// Show.scala case class Show(name: String) object Show: inline given Show = foo private inline def foo: Show = Show("foo")// App.scala @main def app() = println(summon[Show].name)Output
- compile and run
sbt:dotty-bug> run [info] compiling 2 Scala sources to /home/piquerez/lampepfl/dotty-bug/target/scala-3.0.0-RC2/classes ... [info] running app foo [success] Total time: 0 s, completed Mar 23, 2021, 2:55:05 PM - change the implimation of the
private inline foomethod
object Show: inline given Show = foo - private inline def foo: Show = Show("foo") + private inline def foo: Show = Show("bar")- compile and run again
sbt:dotty-bug> run [info] compiling 1 Scala source to /home/piquerez/lampepfl/dotty-bug/target/scala-3.0.0-RC2/classes ... [info] running app foo [success] Total time: 0 s, completed Mar 23, 2021, 2:57:21 PM The app.scala file is not invalidated and thus not recompiled.
The produced program should print "bar" instead of "foo".
Expectation
The app.scala file should be recompiled.
vincenzobaz and Iltotore