diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-04-13 12:08:55 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-04-13 12:08:55 +0200 |
commit | 66904556ef34dc81cbb7c09257b013b3ddb76f78 (patch) | |
tree | af6089b6660d4e0add81200edd5e82bf455580f5 /src | |
parent | b0fceebae53fa140619ccf2cfcb8e4cf7f20f88b (diff) | |
download | scala-66904556ef34dc81cbb7c09257b013b3ddb76f78.tar.gz scala-66904556ef34dc81cbb7c09257b013b3ddb76f78.tar.bz2 scala-66904556ef34dc81cbb7c09257b013b3ddb76f78.zip |
SI-7335 Remove special case for import of Predef._ in Predef.scala
Perhaps this once was problematic, but in our modern age we can
bootstrap perfectly well with this import.
Diffstat (limited to 'src')
-rw-r--r-- | src/reflect/scala/reflect/internal/TreeInfo.scala | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/reflect/scala/reflect/internal/TreeInfo.scala b/src/reflect/scala/reflect/internal/TreeInfo.scala index 0ddcc9fd7b..3296353b6b 100644 --- a/src/reflect/scala/reflect/internal/TreeInfo.scala +++ b/src/reflect/scala/reflect/internal/TreeInfo.scala @@ -663,19 +663,9 @@ abstract class TreeInfo { unapply(dissectApplied(tree)) } - /** Does list of trees start with a definition of - * a class of module with given name (ignoring imports) - */ - def firstDefinesClassOrObject(trees: List[Tree], name: Name): Boolean = trees match { - case Import(_, _) :: xs => firstDefinesClassOrObject(xs, name) - case Annotated(_, tree1) :: _ => firstDefinesClassOrObject(List(tree1), name) - case ModuleDef(_, `name`, _) :: _ => true - case ClassDef(_, `name`, _, _) :: _ => true - case _ => false - } - /** Is this file the body of a compilation unit which should not - * have Predef imported? + * have Predef imported? This is the case iff the first import in the + * unit explicitly refers to Predef. */ def noPredefImportForUnit(body: Tree) = { // Top-level definition whose leading imports include Predef. @@ -684,13 +674,7 @@ abstract class TreeInfo { case Import(expr, _) => isReferenceToPredef(expr) case _ => false } - // Compilation unit is class or object 'name' in package 'scala' - def isUnitInScala(tree: Tree, name: Name) = tree match { - case PackageDef(Ident(nme.scala_), defs) => firstDefinesClassOrObject(defs, name) - case _ => false - } - - isUnitInScala(body, nme.Predef) || isLeadingPredefImport(body) + isLeadingPredefImport(body) } def isAbsTypeDef(tree: Tree) = tree match { |