aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-11-17 18:29:09 +0100
committerMartin Odersky <odersky@gmail.com>2016-11-24 16:43:59 +0100
commit40c1913dd539beb4b6184b37d87e48d98803a465 (patch)
tree833a36016b51d3149525f1f6e7ea18a41d22b192 /tests
parent3588832eb3c45b151d78e66b5cde1f4e772d52a8 (diff)
downloaddotty-40c1913dd539beb4b6184b37d87e48d98803a465.tar.gz
dotty-40c1913dd539beb4b6184b37d87e48d98803a465.tar.bz2
dotty-40c1913dd539beb4b6184b37d87e48d98803a465.zip
More robust scheme for taking start/end of positions when parsing
Some trees, which do not consume input have unassigned positions (so that they can fit in whatever range they are integrated). It's therefore risky to take the start or end of a parsed tree's position. This commit guards against the case where the position of the tree does not exist.
Diffstat (limited to 'tests')
-rw-r--r--tests/neg/i1705.scala24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/neg/i1705.scala b/tests/neg/i1705.scala
new file mode 100644
index 000000000..801adb4b7
--- /dev/null
+++ b/tests/neg/i1705.scala
@@ -0,0 +1,24 @@
+object DepBug {
+ class A {
+ class B
+ def mkB = new B
+ def m(b: B) = b
+ }
+ trait Dep {
+ val a: A
+ val b: a.B
+ }
+ val dep = new {
+ val a = new A
+ val b = a mkB
+ }
+ def useDep(d: Dep) { // error: procedure syntax
+ import d._
+ a m (b)
+ }
+ { // error: Null does not take parameters (follow on)
+ import dep._
+ a m (b)
+ }
+ dep.a m (dep b) // error (follow on)
+}