sbt/sbt — pull request #737 by gkossakowski (2013-04-21 03:23:23+00:00)
Title: Do not normalize/dealias type in api extraction phase

In summary, this series of commits:

* drops type normalization in api phase
* fixes #726 and adds test case covering it
* fixes #736 and adds test case covering it
* addresses problem with main method detection after
dropping type dealiasing

As explained in #736, the api phase cannot normalize/dealias types
because it might miss changes to structure when two type aliases
that dealias to the same type are involved.

It turns out there's no test case that breaks if we remove type
normalization/dealiasing apart from main method detection.

The main method detection implemented by `xsbt.api.Discovery` has a design
flaw because it works with `xsbti.api.*` data structures that represent
structure of Scala problem extracted by API phase. That phase runs before
erasure so it extracts unerased, Scala types. However, a main method is
defined in terms of JVM bytecode types so detection should be implemented
by scanning the bytecode and not Scala types. That would involve adding
support for bytecode scanning and rewriting the whole Discovery object.
Instead of doing that I decided to just add detection of
`scala.Predef.String` type in addition to `java.lang.String` type.
In order to do that I had to hack `Discovery.simpleName` method
implementation. This hack doesn't make it any worse as it was already
hacked in rather arbitrary fashion.

Dropping type normalization also fixes #726 by not running into
stale cache in Scala compiler problem described in SI-7361.