diff options
Diffstat (limited to 'tests/untried/pos/t2018.scala')
-rw-r--r-- | tests/untried/pos/t2018.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/untried/pos/t2018.scala b/tests/untried/pos/t2018.scala new file mode 100644 index 000000000..198b4be42 --- /dev/null +++ b/tests/untried/pos/t2018.scala @@ -0,0 +1,15 @@ +class A { + val b = new B + + def getChildren = List(new A).iterator + + class B { + private def check = true + + private def getAncestor(p: A): A = { + val c = (p.getChildren.find(_.b.check)) match {case Some(d) => d case None => p} + + if (c == p) p else c.b.getAncestor(c) + } + } +} |