aboutsummaryrefslogtreecommitdiff
path: root/tests/debug/tailrec.scala
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-02-13 15:01:03 +0100
committerGitHub <noreply@github.com>2017-02-13 15:01:03 +0100
commit07b67a8416c501d7f7b37442f3a294d9f9252895 (patch)
tree098772eb9ae3e5a64993e1b172505035c9b887ac /tests/debug/tailrec.scala
parent5bcbad29a368bf6a06230aed73488995e733d97a (diff)
parent1489eff397482fec14e5da54e4654278a5c6f7dc (diff)
downloaddotty-07b67a8416c501d7f7b37442f3a294d9f9252895.tar.gz
dotty-07b67a8416c501d7f7b37442f3a294d9f9252895.tar.bz2
dotty-07b67a8416c501d7f7b37442f3a294d9f9252895.zip
Merge pull request #1951 from dotty-staging/fix-1484
fix #1484: position of while incorrect in debug
Diffstat (limited to 'tests/debug/tailrec.scala')
-rw-r--r--tests/debug/tailrec.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/debug/tailrec.scala b/tests/debug/tailrec.scala
new file mode 100644
index 000000000..f79514fa3
--- /dev/null
+++ b/tests/debug/tailrec.scala
@@ -0,0 +1,17 @@
+object Test {
+ def fact(x: Int): Int = {
+ if (x == 0)
+ 1
+ else
+ x * fact(x - 1) // TODO: incorrect this line when x = 0
+ }
+
+
+ def main(args: Array[String]): Unit = {
+ val a = 1 + 2
+ val b = a * 9 // [break] [step: fact]
+ val c = fact(a) // [step: x == 0] [step: fact(x - 1)] [step: x == 0] [cont]
+ fact(0) // [break] [step: x == 0] [step: 1] [step: fact(x - 1)] [step: print]
+ print(c) // [cont]
+ }
+} \ No newline at end of file