Hi Rintcius,
That's not a bug, though in some sense in shouldn't work. In the same way that you're able to write a self-referential val, e.g.
val foo: Int = 10 + foo
Scala can equally find that value by type, i.e. with implicit search.
The justification, I suppose, is that introducing a new scope, as would be necessary to preclude `f` from implicit consideration, would fix only this one, very specific evaluation order issue, but there are plenty more opportunities to access an unevaluated val which it wouldn't fix. Maybe that's a weak argument.
Incidentally, without the type ascription on `f`, compilation will fail, as desired, though that's hardly a solution...
Cheers,
Jon