diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-09-24 14:27:58 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-09-24 16:56:18 +1000 |
commit | fb299f80f3f85e935695d5b7cb7f2c712b150e3c (patch) | |
tree | 4d95bc66e8354e0eb9135aaf1fa102761fb59dff /src/reflect/scala/reflect/runtime/JavaUniverseForce.scala | |
parent | 2c9e506bc32248f9ae4929790a0cb7484a53a66e (diff) | |
download | scala-fb299f80f3f85e935695d5b7cb7f2c712b150e3c.tar.gz scala-fb299f80f3f85e935695d5b7cb7f2c712b150e3c.tar.bz2 scala-fb299f80f3f85e935695d5b7cb7f2c712b150e3c.zip |
Improve presentation compilation of annotations
A trio of problems were hampering autocompletion of annotations.
First, given that that annotation is written before the annotated
member, it is very common to end parse incomplete code that has a
floating annotation without an anotatee.
The parser was discarding the annotations (ie, the modifiers) and
emitting an `EmptyTree`.
Second, the presetation compiler was only looking for annotations
in the Modifiers of a member def, but after typechecking annotations
are moved into the symbol.
Third, if an annotation failed to typecheck, it was being discarded
in place of `ErroneousAnnotation`.
This commit:
- modifies the parser to uses a dummy class- or type-def tree,
instead of EmptyTree, which can carry the annotations.
- updates the locator to look in the symbol annotations of the
modifiers contains no annotations.
- uses a separate instance of `ErroneousAnnotation` for each
erroneous annotation, and stores the original tree in its
`original` tree.
Diffstat (limited to 'src/reflect/scala/reflect/runtime/JavaUniverseForce.scala')
-rw-r--r-- | src/reflect/scala/reflect/runtime/JavaUniverseForce.scala | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala b/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala index 5477bdd6d4..7725e4a2f0 100644 --- a/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala +++ b/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala @@ -106,7 +106,6 @@ trait JavaUniverseForce { self: runtime.JavaUniverse => this.AnnotationInfo this.Annotation this.UnmappableAnnotation - this.ErroneousAnnotation this.ThrownException this.typeNames this.tpnme |