diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-03-25 15:50:41 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-03-25 15:58:32 +0100 |
commit | edee27f59f17873b378d96504d0b20013a31d081 (patch) | |
tree | a87c8a5d5050c9f128381f86346856a0a0a85a66 /test/files/run/t6168/SomeClass.java | |
parent | 1187c9896c097e6e591e5655b35f52c06b3c900a (diff) | |
download | scala-edee27f59f17873b378d96504d0b20013a31d081.tar.gz scala-edee27f59f17873b378d96504d0b20013a31d081.tar.bz2 scala-edee27f59f17873b378d96504d0b20013a31d081.zip |
SI-6168 Retain prefix when parsing types in JVM signatures
When reading Java classfiles, the generic signatures are
used to construct the corresponding Scala type signatures.
In the enclosed test case, the field `SomeClass.f` had
the JVM signature:
LContext<LSomeClass;>.Field<Ljava.lang.Integer;>;
The parser first (correctly) parsed the prefix as `Context[SomeClass]`.
It then looked up the type symbol for `Field` in that that type. It then
discarded the parsed prefix, and instead used the prefix from the
info of the type symbol: `Context[ParentType]`.
This commit changes the signature parser after the first `.` to
use the result of prior parsing as the prefix.
I've also included a test case with Java static inner classes,
which don't require any special treatment.
Diffstat (limited to 'test/files/run/t6168/SomeClass.java')
-rw-r--r-- | test/files/run/t6168/SomeClass.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/run/t6168/SomeClass.java b/test/files/run/t6168/SomeClass.java new file mode 100644 index 0000000000..6f76b829bb --- /dev/null +++ b/test/files/run/t6168/SomeClass.java @@ -0,0 +1,14 @@ +public class SomeClass { + private final Context<SomeClass> context = new Context<SomeClass>(); + { + context.setParent(this); + } + + public final Context<SomeClass>.Field<Integer> f = context.intField(); + + public SomeClass() { + f.set(23).f.set(23); + } +} + + |