scala/scala — pull request #2463 by retronym (2013-04-28 10:58:09+00:00)
Title: SI-7429 Fix checkinit build failure in Contexts

The recent refactoring in Contexts resulted in an uninitialized
field access. This wasn't deadly, as it was already compensating
for this by expecting a null value for `outer` during in the body
of the constructor of Contexts when extended by NoContext.

This commit reworks that code a little to avoid dereferencing the
overriden `outer` field.

A similar mistake in `ImportContext` is also corrected.

```
ticket/7429 ~/code/scala find src/compiler/ | grep Contexts | xargs touch
ticket/7429 ~/code/scala ant -Dscalac.args="-Xcheckinit"
Buildfile: /Users/jason/code/scala/build.xml

desired.jars.uptodate:

boot:

init:
[artifact:dependencies] [WARNING] POM for 'biz.aQute:bndlib:pom:1.43.0:compile' is invalid.
[artifact:dependencies]
[artifact:dependencies] Its dependencies (if any) will NOT be available to the current build.
[echo] build time: 28 April 2013, 12:53:44
[echo] java version: Java HotSpot(TM) 64-Bit Server VM 1.6.0_37 (1.6)
[echo] java args: -Xmx1612M -Xss2M -server -XX:MaxPermSize=180M
[echo] javac args:
[echo] scalac args: -Xcheckinit
[echo] scalac quick args: -Xcheckinit
[echo] git date: 20130428-125245
[echo] git hash: f59be7a783
[echo] maven version: 2.11.0-SNAPSHOT
[echo] OSGi version: 2.11.0.v20130428-125245-f59be7a783
[echo] canonical version: 2.11.0-20130428-125245-f59be7a783
...
quick.comp:
[quick.compiler] Compiling 1 file to /Users/jason/code/scala/build/quick/classes/compiler
[quick.compiler] warning: there were 1 feature warning(s); re-run with -feature for details
[quick.compiler] one warning found
[propertyfile] Updating property file: /Users/jason/code/scala/build/quick/classes/compiler/compiler.properties
[stopwatch] [quick.compiler.timer: 11.834 sec]
...

BUILD SUCCESSFUL
Total time: 19 seconds
ticket/7429 ~/code/scala qbin/scala -e ' "".reverse '
```

Review by @paulp.