Skip to main content

All 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 ...
samthebest's user avatar
  • 31.6k
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 ... ...
jdevelop's user avatar
  • 12.3k