From 9c6a7ad81bdb632d3da144d58210b5903b86a3e4 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Fri, 18 May 2012 14:15:30 +0200 Subject: Fix SI-5544 Type-check annotations in a context with a localDummy owner --- src/compiler/scala/tools/nsc/typechecker/Typers.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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. -- cgit v1.2.3