|
Scala example source code file (lazy-override.scala)
The Scala lazy-override.scala source code/** Test which should fail compilation */ class A { val x: Int = { print("/*A.x*/"); 2 } lazy val y: Int = { print("/*A.y*/"); 2 } } class B extends A { // lazy overrides strict val override lazy val x: Int = { print("/*B.x*/"); 3 } // strict val overrides lazy override val y: Int = { print("/*B.y*/"); 3 } } Other Scala examples (source code examples)Here is a short list of links related to this Scala lazy-override.scala source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.