scala/scala — pull request #1961 by gkossakowski (2013-01-24 01:10:15+00:00)
Title: SI-7009: `@throws` annotation synthesized incorrectly

The 990b3c7 made `scala.throws` annotation polymorphic but forgot to
adapt compiler code that synthesizes it, e.g. when parsing class files.

The consequence was that we would get non-deterministically either
`scala.throws` or `scala.throws[T]` as a type for synthesized annotation.
The reason is that `Symbol.addAnnotation` would call `tpe` method which
does not initialization of symbol so type parameters list would not be
determined correctly. Only if info of that symbol was forced for other
reason we would get `scala.throws[T]`. That non-deterministic behavior
was observed in sbt's incremental compiler.

Here's list of changes this commit introduces:
* The `Symbol.addAnnotation` that takes symbol as argument calls
`typeSymbol` instead of `tpe` for deterministic results
* Introduce `Symbol.addAnnotation` overload that allows us to pass
an applied type
* Change all places where polymorphic annotations are synthesized
to pass an applied type

Fixes SI-7009.

Review by @adriaanm