diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-01-22 00:33:18 +0100 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-06-20 15:46:26 -0700 |
commit | 9b72669a076206f1edbe34464717375c97997cea (patch) | |
tree | 9b62ed2461f2e06e289c504b14d38a757ae02801 /src/library | |
parent | 4e9b33ab24bb3bf922c37a05a79af364b7b32b84 (diff) | |
download | scala-9b72669a076206f1edbe34464717375c97997cea.tar.gz scala-9b72669a076206f1edbe34464717375c97997cea.tar.bz2 scala-9b72669a076206f1edbe34464717375c97997cea.zip |
Set scene for Predef.$scope's demise.
When there's no Predef.$scope but xml is being used,
the compiler aliases scala.xml.TopScope to $scope.
There must be a scala.xml package when xml literals were parsed.
For compatibility with the old library, which relied on $scope being in scope,
synthesize a `import scala.xml.{TopScope => $scope}` when xml is needed,
but there's no Predef.$scope and the old library is detected (scala.xml.TopScope exists).
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/Predef.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala index 5ba38600b6..a188602543 100644 --- a/src/library/scala/Predef.scala +++ b/src/library/scala/Predef.scala @@ -134,7 +134,13 @@ object Predef extends LowPriorityImplicits with DeprecatedPredef { @inline def implicitly[T](implicit e: T) = e // for summoning implicit values from the nether world -- TODO: when dependent method types are on by default, give this result type `e.type`, so that inliner has better chance of knowing which method to inline in calls like `implicitly[MatchingStrategy[Option]].zero` @inline def locally[T](x: T): T = x // to communicate intent and avoid unmoored statements - // Apparently needed for the xml library + // TODO: remove `val $scope = ...` as soon as 2.11.0-M4 is released and used as STARR + // As it has a '$' in its name, we don't have to deprecate first. + // The compiler now aliases `scala.xml.TopScope` to `$scope` (unless Predef.$scope is still there). + // This definition left in place for older compilers and to compile quick with pre-2.11.0-M4 STARR. + // In principle we don't need it to compile library/reflect/compiler (there's no xml left there), + // so a new locker can be built without this definition, and locker can build quick + // (partest, scaladoc still require xml). val $scope = scala.xml.TopScope // errors and asserts ------------------------------------------------- |