79455512

Date: 2025-02-20 18:37:15
Score: 0.5
Natty:
Report link

SLS (Scala Language Specification) says, at https://scala-lang.org/files/archive/spec/3.4/04-basic-definitions.html ,

The scope of a name introduced by a definition is the whole statement sequence containing the definition. However, there is a restriction on forward references in blocks [...]

So this seems to be working as designed, but it isn't clear to me why it's specified this way. Why "the whole statement sequence" rather than "the following statements"?

Reasons:
  • No code block (0.5):
  • Ends in question mark (2):
  • High reputation (-2):
Posted by: Seth Tisue