scala/scala — pull request #2775 by paulp (2013-07-26 00:15:47+00:00)
Title: NoSymbol does have owner: NoSymbol.

I realize there may be some romantic attachment to "NoSymbol
does not have owner", but has anyone ever wondered why in almost
every similar situation we do something different? Here are a
few other methods which seek a symbol which if it existed
would be among NoSymbol's owners, and how they handle it:

override def enclClass: Symbol = this
override def enclosingTopLevelClass: Symbol = this
override def enclosingPackageClass: Symbol = this
override def enclMethod: Symbol = this
override def originalEnclosingMethod = this

And NoContext.outer == NoContext, and so on. We do it that
way because it's a much better way to go about things. There
are a huge variety of contexts in which NoSymbol might
legitimately appear; there are a huge number of methods which
call owner, often ten method calls away from the initiating
caller, who likely has no clue owner will be called; there is
no reason we should all have to play constant (poor) defense
against no-owner-pointer-exceptions.