u/RaymondBKR

▲ 7 r/scala

Use of uninitialized val doesn't result in a compiler failure

​

object test:

val y = x

val x = 5

Will compiles but test.y will = 0. I want it to fail to compile is there a way to do that? -Wsafe-init sounds like it should but doesn't.

reddit.com
u/RaymondBKR — 1 day ago