All Questions
2 questions
0
votes
1
answer
231
views
How to avoid lazy vals when using cross dependent traits in cake pattern without additional traits
Suppose we have
scala> trait A { val y: Int; val x = 1; val y2 = y + 1 }
scala> trait B { val y: Int = 1; val x: Int; val x2 = x + 1 }
scala> class C extends A with B
Then both y2 and x2 ...
6
votes
1
answer
828
views
Scala :: lazy value is null unless printed?
Given the trait (simplified)
trait A {
val eventStream: EventStream
val credentialsStorage = // something here
val userStorage = // something here
val crypto = // something here
...
...