summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Namers.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2009-06-15 10:13:11 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2009-06-15 10:13:11 +0000
commit9b046d09520c79538e1468b15cccaf8a616e6462 (patch)
treeb6c01059857a9e80289435d977eaa90c17f3706d /src/compiler/scala/tools/nsc/typechecker/Namers.scala
parent5fe886ed6485c98acb76846634555825ea75732d (diff)
downloadscala-9b046d09520c79538e1468b15cccaf8a616e6462.tar.gz
scala-9b046d09520c79538e1468b15cccaf8a616e6462.tar.bz2
scala-9b046d09520c79538e1468b15cccaf8a616e6462.zip
- fixed #2057
- Symbol.annotations now first calls .initialize
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 5f490592f5..20061515c8 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -1060,7 +1060,9 @@ trait Namers { self: Analyzer =>
// they were added only in typer, depending on the compilation order, they would
// be visible or not
val annotated = if (sym.isModule) sym.moduleClass else sym
- if (annotated.annotations.isEmpty) tree match {
+ // typeSig might be called multiple times, e.g. on a ValDef: val, getter, setter
+ // parse the annotations only once.
+ if (annotated.rawAnnotations.isEmpty) tree match {
case defn: MemberDef =>
val ainfos = defn.mods.annotations filter { _ != null } map { ann =>
// need to be lazy, #1782