diff options
author | Lukas Rytz <lukas.rytz@epfl.ch> | 2009-06-15 10:13:11 +0000 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@epfl.ch> | 2009-06-15 10:13:11 +0000 |
commit | 9b046d09520c79538e1468b15cccaf8a616e6462 (patch) | |
tree | b6c01059857a9e80289435d977eaa90c17f3706d /src/compiler/scala/tools/nsc/typechecker/Namers.scala | |
parent | 5fe886ed6485c98acb76846634555825ea75732d (diff) | |
download | scala-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.scala | 4 |
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 |