scala/scala — pull request #3340 by huitseeker (2014-01-08 18:43:10+00:00)
Title: SI-8126 adds a -source option to let (parts of) the compiler run on older code

This adds a -source flag and puts various 2.10 source-level
compatibility-breaking fixes under it (so that the fixed codepath
doesn't run with -source:2.10).

The last commit adds another (early) setting (-Yrelax-variance-checks)
for the specific checks brought by SI-6566, fixed in a419799f87. This
is needed to bypass the stricter (and correct) variance checks done in
reflect/internal/Variances. -Y-relax-variance-checks, contrarily to
-source, doesn't depend on the nsc.settings.ScalaVersion class. This
option is turned on by '-source:2.10'

This has been tested by compiling the 2.10 scala library (using the
compiler in this PR , with "-source:2.10 -Ystop-after:typer") using
this project: https://github.com/huitseeker/scala-library

review by @dragos or @retronym.