diff options
author | ghik <romeqjanoosh@gmail.com> | 2014-09-17 20:45:01 +0200 |
---|---|---|
committer | ghik <romeqjanoosh@gmail.com> | 2014-09-17 20:45:01 +0200 |
commit | 7c81959d724a6565c00b86591d54c195d8bed1de (patch) | |
tree | 42ad6d8ddfcb0a06111bbb6feb2438a5e5791e3b /test/files/presentation/t8459.check | |
parent | 190c6726158f3f7e1ac5d26782437c184cee5872 (diff) | |
download | scala-7c81959d724a6565c00b86591d54c195d8bed1de.tar.gz scala-7c81959d724a6565c00b86591d54c195d8bed1de.tar.bz2 scala-7c81959d724a6565c00b86591d54c195d8bed1de.zip |
SI-8459 fix incorrect positions for incomplete selection trees
The mentioned issue is a presentation compiler issue, but its root cause is a bug in the parser which incorrectly assigned positions to incomplete selection trees (i.e. selections that lack an indentifier after dot and have some whitespace instead).
In detail: for such incomplete selection trees, the "point" of the position should be immediately after the dot but instead was at the start of next token after the dot. For range positions, this caused a pathological situation where the "point" was greater than the "end" of the position. This position is later used by the typechecker during resolution of dynamic calls and causes it to crash. Of course, because a syntactically incorrect code is required for the bug to manifest, it only happens in the presentation compiler.
Diffstat (limited to 'test/files/presentation/t8459.check')
-rw-r--r-- | test/files/presentation/t8459.check | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/presentation/t8459.check b/test/files/presentation/t8459.check new file mode 100644 index 0000000000..336c147141 --- /dev/null +++ b/test/files/presentation/t8459.check @@ -0,0 +1,14 @@ +reload: IncompleteDynamicSelect.scala + +askType at IncompleteDynamicSelect.scala(12,2) +================================================================================ +[response] askTypeAt (12,2) +scala.AnyRef { + def <init>(): Foo = { + Foo.super.<init>(); + () + }; + private[this] val bar: F = new F(); + Foo.this.bar.<selectDynamic: error>("<error>") +} +================================================================================ |