changes the order of whitebox typechecks. yes, again.

My first attempt at SI-6992 was about having whitebox expansions first
typecheck against outerPt and only then verify that the result is compatible
with innerPt.

That was a nice try, but soon after it went live in 2.11.0-M8, we've got
multiple reports with problems - both shapeless and then in a week specs2
started having issues with their whitebox macros.

In shapeless, typecheck against outerPt screwed up type inference, which
was more or less fixable by explicit type annotations, so I decided to
wait a bit before jumping to conclusions.

However, in specs2 the problem was more insidious. After being typechecked
against outerPt, expansions were being implicitly converted to a type
that became incompatible with innerPt. This revealed a fatal flaw of the
implemented approach - if allowed to typecheck against outerPt first,
whitebox macros could never be robust.

Now realizing that "outerPt > innerPt" doesn't work, I nevertheless wasn't
looking forward to rolling that back to "innerPt > outerPt", because that
would revive SI-6992 and SI-8048 that are highly unintuitive, especially
the latter one.

Therefore, this commit combines the permissiveness of "... > innerPt"
approaches with the robustness of "innerPt > outerPt", introducing
"WildcardType > innerPt > outerPt".
SI-8226 Deduplicate Scala's Tokens and JavaTokens
SI-8258 Revert "SI-7335 Remove special case for import of Predef._

This reverts commit 66904556ef34dc81cbb7c09257b013b3ddb76f78.

Conflicts:
    src/reflect/scala/reflect/internal/TreeInfo.scala

As evidenced by the highlights of the stack trace in Scala IDE,
my assertion in the 66904556e wasn't universally true.

The change was only motivated by removing a special case, not in
order to fix some other problem. So the revert is the most straight
forward course of action for now.

I haven't pinned this down with a test outside of Eclipse, and
given the lateness of the hour wrt 2.11.0, I'll have to submit
without one.

    2013-03-10 08:38:04,690 ERROR [main] - org.scala-ide.sdt.core - org.scala-ide.sdt.core - org.scala-ide.sdt.core - 0 - Error during askOption
    scala.reflect.internal.Symbols$CyclicReference: illegal cyclic reference involving object Predef
    ...
    at scala.reflect.internal.Symbols$Symbol.lock(Symbols.scala:482)
    at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1216)
    at scala.reflect.internal.Symbols$Symbol.tpe(Symbols.scala:1200)
    at scala.reflect.internal.Symbols$Symbol.tpeHK(Symbols.scala:1201)
    at scala.reflect.internal.Types$Type.computeMemberType(Types.scala:784)
    at scala.reflect.internal.Types$Type.memberType(Types.scala:781)
    at scala.reflect.internal.TreeGen.mkAttributedSelect(TreeGen.scala:203)
    ...
    at scala.reflect.internal.TreeGen.mkAttributedStableRef(TreeGen.scala:162)
    at scala.tools.nsc.ast.TreeGen.mkWildcardImport(TreeGen.scala:39)
    at scala.tools.nsc.typechecker.Contexts$Context.makeNewImport(Contexts.scala:308)
    at scala.tools.nsc.typechecker.Contexts$class.rootContext(Contexts.scala:69)
    at scala.tools.nsc.Global$$anon$1.rootContext(Global.scala:492)
    at scala.tools.nsc.typechecker.Contexts$class.rootContext(Contexts.scala:64)
    at scala.tools.nsc.Global$$anon$1.rootContext(Global.scala:492)
    at scala.tools.nsc.typechecker.Analyzer$namerFactory$$anon$1.apply(Analyzer.scala:43)
    at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:463)
    ...
    at scala.tools.nsc.Global$Run.compileLate(Global.scala:1681)
    at scala.tools.nsc.Global$Run.compileLate(Global.scala:1671)
    at scala.tools.nsc.symtab.SymbolLoaders$SourcefileLoader.doComplete(SymbolLoaders.scala:284)
    at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:187)
    at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1229)
    at scala.reflect.internal.Symbols$Symbol.tpe(Symbols.scala:1200)
    at scala.reflect.internal.Symbols$Symbol.tpeHK(Symbols.scala:1201)
    at scala.reflect.internal.Types$Type.computeMemberType(Types.scala:784)
    at scala.reflect.internal.Types$Type.memberType(Types.scala:781)
    at scala.reflect.internal.TreeGen.mkAttributedSelect(TreeGen.scala:203)
    at scala.reflect.internal.TreeGen.mkAttributedRef(TreeGen.scala:124)
    at scala.reflect.internal.TreeGen.mkAttributedRef(TreeGen.scala:130)
    at scala.reflect.internal.TreeGen.mkAttributedStableRef(TreeGen.scala:162)
    at scala.tools.nsc.ast.TreeGen.mkWildcardImport(TreeGen.scala:39)
    ...
    at scala.tools.nsc.Global$$anon$1.rootContext(Global.scala:492)
    at scala.tools.nsc.typechecker.Analyzer$namerFactory$$anon$1.apply(Analyzer.scala:43)
    at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:463)
    ...
    at scala.tools.nsc.Global$Run.compileLate(Global.scala:1671)
    at scala.tools.nsc.symtab.SymbolLoaders$SourcefileLoader.doComplete(SymbolLoaders.scala:284)
    at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:187)
    at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1229)
    at scala.reflect.internal.Symbols$Symbol.initialize(Symbols.scala:1365)
    ...
    at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:153)
    at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:306)
    at scala.tools.eclipse.javaelements.ScalaJavaMapper$class.initializeRequiredSymbols(ScalaJavaMapper.scala:29)
    ...
    at scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:26)
    at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:340)
Start the PC thread only after initialization of required symbols.

If the class path is incomplete, the presentation compiler might crash during construction.
If the PC thread was already started, it will never get the chance to shutdown, and the
thread leaks. In the IDE, where the PC is started when needed, this can lead to a very
quick depletion of JVM threads.

See Scala IDE #1002016.
SI-8219 Pending test case for unpositioned implicit error

Extracted with tweezers from ScalaTest and Scalacheck implicits.

    % scalac-hash v2.11.0-M7 test/pending/pos/t8219.scala
    error: type mismatch;
     found   : Any
     required: AnyRef
    Note: Any is not implicitly converted to AnyRef.  You can safely
    pattern match `x: AnyRef` or cast `x.asInstanceOf[AnyRef]` to do so.
    error: type mismatch;
     found   : Any
     required: AnyRef
    Note: Any is not implicitly converted to AnyRef.  You can safely
    pattern match `x: AnyRef` or cast `x.asInstanceOf[AnyRef]` to do so.
    two errors found
SI-8219 Pending test to show suspicous overload in == in AnyRef

    % scalac-hash v2.11.0-M7 test/pending/neg/t8219-any-any-ref-equals.scala
    test/pending/neg/t8219-any-any-ref-equals.scala:5: error: overloaded method value == with alternatives:
      (x$1: AnyRef)Boolean <and>
      (x$1: Any)Boolean
     does not take type parameters
      "".==[Int]
         ^
    one error found

Usually for Java-originated methods, we are allow Object and Any
to unify pre-erasure in method signatures. This is handled in
`matchesParams`, and is predicated on whether the method type is
an instance of `JavaMethodType`

For instance, we are allowed to:

    scala> class C { override def equals(a: Any) = false }
    defined class C

On account of:

    scala> typeOf[Object].decl(nme.equals_).info.getClass
    res7: Class[_ <: $r.intp.global.Type] = class scala.reflect.internal.Types$JavaMethodType

But:

    scala> typeOf[Object].decl(nme.EQ).defString
    res8: String = final def ==(x$1: AnyRef): Boolean

    scala> typeOf[Object].decl(nme.EQ).info.getClass
    res9: Class[_ <: $r.intp.global.Type] = class scala.reflect.internal.Types$MethodType

More special casing is probably needed.
SI-8129 Make Object#== override Any#==

And the same for !=

If we tried to declare these signatures in non-fictional classes,
we would be chastised about collapsing into the "same signature after
erasure".

This will have an influence of typing, as the typechecking of
arguments is sensitive to overloading: if multiple variants are
feasible, the argument will be typechecked with a wildcard expected
type. So people inspecting the types of the arguments to `==` before
this change might have seen an interesting type for
`if (true) x else y`, but now the `If` will have type `Any`, as we
don't need to calculate the LUB.

I've left a TODO to note that we should really make `Any#{==, !=}`
non-final and include a final override in `AnyVal`. But I don't think
that is particularly urgent.
SI-8129 Crack the case of the curiously incoherent Context

 - Typer is created with Context.
 - Typer creates an Inferencer with said Context.
 - Typer mutates Typer#context after each import statement
 - Typer mutates its current Context (e.g to disable implicits.)
 - Typer asks a question of Inferencer
 - Inferencer, looking at the old context, thinks that implicits
   are allowed
 - Inferencer saves implicit ambiguities into the wrong Context.

Because of this bug, overload resolution in blocks or template
bodies for applications that follow an import have been
considering implicit coercions in the first try at static overload
resolution, and, in the rare case that it encounters an ambigous
implicit in the process, leaking an unpositioned ambiguout error.

This commit ensures coherency between `typer.context` and
`typer.infer.context` by making the latter delegate to the former.
Merge pull request #3502 from retronym/ticket/8258

Fix regression for using Scala IDE on scala-library
Merge pull request #3497 from adriaanm/rebase-3464

 Make Object#== override Any#==
SI-8167 readLine shold flush output before reading input

As reported on scala-user:

> Using `scala.Predef.readLine(text: String, args: Any*)`
> on Windows causes strange behavior. If I am leaving some
> part of `text` unforced to be flushed (say, "---\nEnter new
>  expression >") then "Enter new expression >" flushed only
> after Enter press. Still, it works fine on Ubuntu and (seems like)
> on MacOS.
>
> My workaround is to force `java.lang.System.out` (that readLine
> depends on to write welcome string) to flush output like
> "---\nEnter new expression >\n".
Merge pull request #3504 from gkossakowski/readline-flush

 readLine shold flush output before reading input
Merge pull request #3456 from soc/SI-8226

SI-8226 Deduplicate JavaTokens/ScalaTokens
Tweak parser entry point for pq

Previously pq used pattern1 which required parens to be used in
alternative pattern. This commit tweaks it to allow pq"a | b"
syntax. Also adds some tests for alternative syntax.
Merge pull request #3505 from densh/topic/pq-entry

Tweak parser entry point for pq""
Merge pull request #3495 from xeno-by/ticket/8209

changes the order of whitebox typechecks. yes, again.