diff options
author | Lukas Rytz <lukas.rytz@epfl.ch> | 2012-05-18 14:15:30 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@epfl.ch> | 2012-05-18 14:15:30 +0200 |
commit | 9c6a7ad81bdb632d3da144d58210b5903b86a3e4 (patch) | |
tree | 3ff90b7f8768dc6273a2c5af8608db0f5b44e98e /src/compiler | |
parent | ef7708812fac32ca0c2a05330222a6b0806c9054 (diff) | |
download | scala-9c6a7ad81bdb632d3da144d58210b5903b86a3e4.tar.gz scala-9c6a7ad81bdb632d3da144d58210b5903b86a3e4.tar.bz2 scala-9c6a7ad81bdb632d3da144d58210b5903b86a3e4.zip |
Fix SI-5544
Type-check annotations in a context with a localDummy owner
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index b5e58efaff..7419ec3bce 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3246,7 +3246,9 @@ trait Typers extends Modes with Adaptations with Taggings { reportAnnotationError(NestedAnnotationError(ann, annType)) } else { val typedAnn = if (selfsym == NoSymbol) { - typed(ann, mode, annClass.tpe) + // local dummy fixes SI-5544 + val localTyper = newTyper(context.make(ann, context.owner.newLocalDummy(ann.pos))) + localTyper.typed(ann, mode, annClass.tpe) } else { // Since a selfsym is supplied, the annotation should have // an extra "self" identifier in scope for type checking. |