SI-1503 don't assume unsound type for ident/literal patterns

The fix only kicks in under -Xfuture. We also warn under -Xlint.

What type should a variable bound to the value matched by a pattern have?
To avoid CCEs, it should be a type that's implied by the matching
semantics of the pattern.

Usually, the type implied by a pattern matching a certain value
is the pattern's type, because pattern matching implies instance-of checks.

However, Stable Identifier and Literal patterns are matched using `==`,
which does not imply a type for the binder that binds the matched value.

The change in type checking due to this fix is that programs that used to crash with a CCE
(because we blindly cast to the type of the pattern, which a `==` check does not imply)
now get a weaker type instead (and no cast). They may still type check, or they may not.

To compensate for this fix, change `case x@Foo => x` to `case x: Foo.type => x`,
if it's important that `x` have type `Foo.type`.

See also:
- SI-4577: matching of singleton type patterns uses `eq`,
  not `==` (so that the types are not a lie).
- SI-5024: patmat strips unused bindings, but affects semantics
SI-5479 deprecate DelayedInit outside of App

DelayedInit's semantics are way too surprising.

For example, it delays initialization of fields,
so that fields on objects that extend `App`
(which `extends DelayedInit`) are not initialized
until the `main` method is called.

For more details and a proposed alternative,
see https://issues.scala-lang.org/browse/SI-4330?jql=labels%20%3D%20delayedinit%20AND%20resolution%20%3D%20unresolved.

Support for `App` will continue -- we'll special case it.
SI-8315 Better debugging facility for ICode

Suffix the phase name to avoid clobbering files.

	% qbin/scalac -Xprint-icode -Xprint:inline -Yinline -Ydead-code sandbox/test.scala 1>/dev/null 2>/dev/null
	% ls *.icode
	A$$anonfun$crash$1_icode.icode		Listt_icode.icode
	A$$anonfun$crash$1_inliner.icode	Listt_inliner.icode
	A_icode.icode				Nill$_icode.icode
	A_inliner.icode				Nill$_inliner.icode
SI-8315 Fix crash in dead code elimination

It was a cache invalidation bug.

We need to mark the Code as touched to invalidate the caches
behind `predecessors` and `successors`.
SI-5479 link to release notes instead of jira query
minor code cleanup in the macro engine
SI-8321 whitebox bundles are now recognized as such

whitebox.Context <: blackbox.Context, so in order to check for blackboxity
it's not enough to check whether the context used is <: blackbox.Context.
bundles now reject invalid context types

Vanilla macros only allow blackbox.Context, whitebox.Context and
PrefixType refinements thereof. Bundles should behave in the same way.
prohibits polymorphic bundles

It's not like they were inducing bugs, but I can't see how polymorphism
can be useful for macro bundles, hence imho it's better to reduce the
number of degrees of freedom of the system.
more helpful bundle error messages

At the moment, bundle selection mechanism is pretty picky. If a candidate
bundle's parameter isn't either blackbox.Context, whitebox.Context or
PrefixType refinement thereof, then it's not a bundle and the user
will get a generic error.

However we can be a bit more helpful and admit classes that are almost
like bundles (looksLikeMacroBundleType), have them fail isMacroBundleType,
and then emit a much prettier error message to the user that would tell them
that bundles must be monomorphic and their sole parameter should not just
be any subtype of blackbox.Context or whitebox.Context.
more tests for macro bundles

Given the recent glaring oversight in macro bundles, I have to have more
tests in order to make sure that things are going to work as they should.
more clean up in the macro engine

Now when SI-7507 is fixed in starr, we can actually remove a workaround
and make a 10 line reduction in the size of Resolvers.scala.
SI-8197 Only consider immediate params for defaults, overloading

A recent commit fixed the behaviour of overloading with regards
to discarding candiates that include default arguments. The old
check was checking the wrong flag.

But, the new code is actually checking all parameter lists for
defaults, which led to a regression in scala-io, which is distilled
in the enclosed test case. Applications are typechecked one
parameter list at a time, so a holistic check for defaults doesn't
seem to make sense; only defaults in the first parameter list
ought to count.
SI-8324 Fix regression in override checks for sealed classes

adeffda25 changed `Symbol#isEffectivelyFinal` to help the optimizer
by inferring finality within sealed class hierarchies.

However, this change wasn't neccesarily welcome for other clients of
that method. In the enclosed test case, we see that overriding checks
in `RefChecks` regressed.

This commit moves the enhanced version into a new method and
selectively uses it in the optimizer (and the tail call optimizer).
Merge pull request #3567 from retronym/ticket/8315

SI-8315 Fix crash in dead code elimination
SI-7962 Scalac runner does not work within Emacs's terminal

  - Always set the env.emacs system property - scalac only cares
    about whether the system property has a non-empty value, not
    whether it is set or not. Fixes 7962
Merge pull request #3563 from adriaanm/t5479

SI-5479 deprecate DelayedInit outside of App
Fix ./build/<stage>/bin/scaladoc

Was:

    ./build/quick/bin/scaladoc -version
    Exception in thread "main" java.lang.NoClassDefFoundError: scala/tools/nsc/ScalaDoc
    Caused by: java.lang.ClassNotFoundException: scala.tools.nsc.ScalaDoc

Now:

    % for tool in ./build/quick/bin/{fsc,scala,scalac,scaladoc,scalap}; do $tool -version; done
    Fast Scala compiler version 2.11.0-20140222-144307-b0dcf79875 -- Copyright 2002-2013, LAMP/EPFL
    Scala code runner version 2.11.0-20140222-144307-b0dcf79875 -- Copyright 2002-2013, LAMP/EPFL
    Scala compiler version 2.11.0-20140222-144307-b0dcf79875 -- Copyright 2002-2013, LAMP/EPFL
    Scaladoc version 2.11.0-20140222-144307-b0dcf79875 -- Copyright 2002-2013, LAMP/EPFL
    Scala classfile decoder version 2.0.1 -- (c) 2002-2013 LAMP/EPFL
Merge pull request #3572 from retronym/ticket/8197

SI-8197 Only consider immediate params for defaults, overloading
Merge pull request #3573 from retronym/ticket/8324

SI-8324 Fix regression in override checks for sealed classes