diff options
author | Martin Odersky <odersky@gmail.com> | 2016-08-24 09:50:42 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-08-26 11:13:17 +0200 |
commit | f8970818e3d285b7827a035bffb26c1a4b97319e (patch) | |
tree | 4f5ce7eef7a5ae1bb9de892c4d626eed8757afb0 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | 86d930bf89aa89e07fdc40ed40431ffea2085090 (diff) | |
download | dotty-f8970818e3d285b7827a035bffb26c1a4b97319e.tar.gz dotty-f8970818e3d285b7827a035bffb26c1a4b97319e.tar.bz2 dotty-f8970818e3d285b7827a035bffb26c1a4b97319e.zip |
Type annotations in context enclosing the annotated definition
Fixes SI-7426, which caused a double definition before.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index c9a2e4b48..f0086b0ab 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -1072,8 +1072,9 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit def completeAnnotations(mdef: untpd.MemberDef, sym: Symbol)(implicit ctx: Context): Unit = { // necessary to force annotation trees to be computed. sym.annotations.foreach(_.tree) + val annotCtx = ctx.outersIterator.dropWhile(_.owner == sym).next // necessary in order to mark the typed ahead annotations as definitely typed: - untpd.modsDeco(mdef).mods.annotations.foreach(typedAnnotation) + untpd.modsDeco(mdef).mods.annotations.foreach(typedAnnotation(_)(annotCtx)) } def typedAnnotation(annot: untpd.Tree)(implicit ctx: Context): Tree = track("typedAnnotation") { |