Dotty: Lazy Val named "_" Is Not Actually Lazy

Created on 3 Dec 2019  路  3Comments  路  Source: lampepfl/dotty

object Example extends App {
  lazy val _ = ??? // throws an exception
  println("Hello, World!")
}
bug

Most helpful comment

Cute, but it would help everyone even more if you explained why it does not work. If you had pointed out that the val must be _ for it to fail you would have saved people valuable time in which they could fix bugs instead of solving puzzles.

All 3 comments

Cute, but it would help everyone even more if you explained why it does not work. If you had pointed out that the val must be _ for it to fail you would have saved people valuable time in which they could fix bugs instead of solving puzzles.

@odersky I'm really sorry. You're totally right. I was busy and just posted the failing example but I could have shared more context to help with diagnosing and resolving the issue. Please accept my apologies. I will keep that in mind for next time. Really appreciate all the work that you and everyone else on the team are doing.

@adamgfraser No worries! I was a bit stressed out myself and should have worded my response better. Your feedback and contributions are very important for us.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

julienrf picture julienrf  路  3Comments

hmf picture hmf  路  3Comments

NightMachinary picture NightMachinary  路  3Comments

Blaisorblade picture Blaisorblade  路  3Comments

deusaquilus picture deusaquilus  路  3Comments