bug
bug copied to clipboard
objects should override lazy values
Title says it all. Right now you cannot override a lazy val with an object. But I think you should be able to do this, or else you will be locked in forever in lazy vals.
Imported From: https://issues.scala-lang.org/browse/SI-5187?orig=1 Reporter: @odersky
@paulp said: Since we have objects overriding objects in -Xexperimental, then to complete the circuit one should also be able to override an object with a lazy val.
Scala 3.6.3:
scala> class C { lazy val x: AnyRef = new AnyRef }
// defined class C
scala> class D extends C { override object x }
// defined class D