aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/ted.scala
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2015-12-26 22:12:57 +0100
committerGuillaume Martres <smarter@ubuntu.com>2015-12-26 22:12:57 +0100
commit2427f056447ab3f9a0ceaa001353eb0a4067e1bb (patch)
treeb9013e390a217a2da5f46401164958adf44d48de /tests/pos/ted.scala
parentc66613de7f32cfabbca765a96f1a3cc0ea2d5bcb (diff)
parente51b8845fb20fe3a4e1c655d4b72e2833906bbc2 (diff)
downloaddotty-2427f056447ab3f9a0ceaa001353eb0a4067e1bb.tar.gz
dotty-2427f056447ab3f9a0ceaa001353eb0a4067e1bb.tar.bz2
dotty-2427f056447ab3f9a0ceaa001353eb0a4067e1bb.zip
Merge pull request #1006 from dotty-staging/more-tests
More tests
Diffstat (limited to 'tests/pos/ted.scala')
-rw-r--r--tests/pos/ted.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/pos/ted.scala b/tests/pos/ted.scala
new file mode 100644
index 000000000..314f10932
--- /dev/null
+++ b/tests/pos/ted.scala
@@ -0,0 +1,18 @@
+object App
+{
+ def exponentiate(base : Double, exponent : Double) : Double =
+ (base, exponent) match
+ {
+ case (0, 0) => 1.0
+ case (b, 0) => 1.0
+ case (b, 1) => b
+ case (b, e) => b * exponentiate(b, e - 1)
+ }
+
+
+
+ def main(args : Array[String]) =
+ System.out.println(exponentiate(2, 2))
+
+}
+