This doesn’t compile with error on the first line “Variable ‘b’ must be initialized”
val a = b
val b = “hello”
I think the java version of this error is more informative, “Illegal forward reference”.
But why can’t the compiler figure out the forward reference for me? If I put the declarations in different files the compiler has no problem figuring it out.