aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/run
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-06-16 13:20:19 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-16 16:42:54 +0200
commitbb940560529ba460af4caa967caaa7f34f944b04 (patch)
tree5eb4ff7ba0bfaf171e3d26bf8dddfeb86ddc80ef /tests/pending/run
parent78fae1152a7b381af4639d3d66ed637eac3ca9d0 (diff)
downloaddotty-bb940560529ba460af4caa967caaa7f34f944b04.tar.gz
dotty-bb940560529ba460af4caa967caaa7f34f944b04.tar.bz2
dotty-bb940560529ba460af4caa967caaa7f34f944b04.zip
Avoid spurious StaleSymbol error in <refinement> members
Refinement classes and their members could give spurious stale symbol errors if the symbol is loaded in a different run than the classfile containing it. The problem is that refinement classes do not form part of the scope of their owners. The fix assumes that refinement classes are always "stillValid".
Diffstat (limited to 'tests/pending/run')
-rw-r--r--tests/pending/run/Course-2002-10.check46
-rw-r--r--tests/pending/run/Course-2002-10.scala135
2 files changed, 0 insertions, 181 deletions
diff --git a/tests/pending/run/Course-2002-10.check b/tests/pending/run/Course-2002-10.check
deleted file mode 100644
index 207b671f0..000000000
--- a/tests/pending/run/Course-2002-10.check
+++ /dev/null
@@ -1,46 +0,0 @@
-fib(0) = 0
-fib(1) = 1
-fib(2) = 1
-fib(3) = 2
-fib(4) = 3
-fib(5) = 5
-fib(6) = 8
-fib(7) = 13
-fib(8) = 21
-fib(9) = 34
-fib(10) = 55
-fib(11) = 89
-fib(12) = 144
-fib(13) = 233
-fib(14) = 377
-fib(15) = 610
-fib(16) = 987
-fib(17) = 1597
-fib(18) = 2584
-fib(19) = 4181
-
-pi(0) = 4.0 , 3.166666666666667 , 4.0
-pi(1) = 2.666666666666667 , 3.1333333333333337, 3.166666666666667
-pi(2) = 3.466666666666667 , 3.1452380952380956, 3.142105263157895
-pi(3) = 2.8952380952380956, 3.1396825396825396, 3.1415993573190044
-pi(4) = 3.33968253968254 , 3.142712842712843 , 3.141592714033778
-pi(5) = 2.976046176046176 , 3.140881340881341 , 3.1415926539752923
-pi(6) = 3.283738483738484 , 3.142071817071817 , 3.141592653591176
-pi(7) = 3.017071817071817 , 3.1412548236077646, 3.141592653589777
-pi(8) = 3.252365934718876 , 3.1418396189294024, 3.141592653589794
-pi(9) = 3.0418396189294024, 3.141406718496502 , 3.1415926535897936
-pi = 3.141592653589793 , 3.141592653589793 , 3.141592653589793
-
-ln(0) = 1.0 , 0.7 , 1.0
-ln(1) = 0.5 , 0.6904761904761905, 0.7
-ln(2) = 0.8333333333333333, 0.6944444444444444, 0.6932773109243697
-ln(3) = 0.5833333333333333, 0.6924242424242424, 0.6931488693329254
-ln(4) = 0.7833333333333333, 0.6935897435897436, 0.6931471960735491
-ln(5) = 0.6166666666666667, 0.6928571428571428, 0.6931471806635636
-ln(6) = 0.7595238095238095, 0.6933473389355742, 0.6931471805604038
-ln(7) = 0.6345238095238095, 0.6930033416875522, 0.6931471805599444
-ln(8) = 0.7456349206349207, 0.6932539682539682, 0.6931471805599426
-ln(9) = 0.6456349206349206, 0.6930657506744463, 0.6931471805599453
-ln = 0.6931471805599453, 0.6931471805599453, 0.6931471805599453
-
-prime numbers: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113
diff --git a/tests/pending/run/Course-2002-10.scala b/tests/pending/run/Course-2002-10.scala
deleted file mode 100644
index 4cfa1deb0..000000000
--- a/tests/pending/run/Course-2002-10.scala
+++ /dev/null
@@ -1,135 +0,0 @@
-//############################################################################
-// Programmation IV - 2002 - Week 10
-//############################################################################
-
-import math.{Pi, log}
-
-object M0 {
-
- def addStream (s1: Stream[Int], s2: Stream[Int]): Stream[Int] =
- Stream.cons(s1.head + s2.head, addStream(s1.tail, s2.tail));
-
- val fib: Stream[Int] =
- Stream.cons(0, Stream.cons(1, addStream(this.fib, this.fib.tail)));
-
- def test = {
- var i = 0;
- fib.take(20).foreach(n => {Console.println("fib("+i+") = "+n); i=i+1});
- Console.println;
- }
-}
-
-//############################################################################
-
-object M1 {
-
- def scale(x: Double, s: Stream[Double]): Stream[Double] =
- s map { e: Double => e*x }
-
- def partialSums(s: Stream[Double]): Stream[Double] =
- Stream.cons(s.head, partialSums(s.tail) map (x => x + s.head));
-
- def euler(s: Stream[Double]): Stream[Double] = {
- val nm1 = s apply 0;
- val n = s apply 1;
- val np1 = s apply 2;
- Stream.cons(np1 - ((np1 - n)*(np1 - n) / (nm1 - 2*n + np1)),euler(s.tail))
- };
-
- def better(s: Stream[Double], transform: Stream[Double] => Stream[Double])
- : Stream[Stream[Double]] =
- Stream.cons(s, better(transform(s), transform));
-
- def veryGood(s: Stream[Double], transform: Stream[Double] => Stream[Double])
- : Stream[Double] =
- better(s, transform) map (x => x.head);
-
- def lnSummands(n: Double): Stream[Double] =
- Stream.cons(1.0 / n, lnSummands(n + 1.0) map { x: Double => -x })
-
- var ln0 = partialSums(lnSummands(1.0));
- var ln1 = euler(ln0);
- var ln2 = veryGood(ln0, euler);
-
- def piSummands(n: Double): Stream[Double] =
- Stream.cons(1.0 / n, piSummands(n + 2.0) map { x: Double => -x })
-
- var pi0 = scale(4.0, partialSums(piSummands(1.0)));
- var pi1 = euler(pi0);
- var pi2 = veryGood(pi0, euler);
-
- def pad(s: String, n: Int): String =
- if (n <= 0) s.substring(0, s.length() + n)
- else pad(s + " ", n - 1);
- def str(d: Double) = { val s = d.toString(); pad(s, 18 - s.length()) };
-
- def test = {
- var i = 0;
- while (i < 10) {
- Console.print("pi("+i+") = ");
- Console.print(str(pi0.apply(i)) + ", ");
- Console.print(str(pi1.apply(i)) + ", ");
- Console.print(str(pi2.apply(i)) + "\n");
- i = i + 1;
- }
- Console.print("pi = ");
- Console.print(str(Pi) + ", ");
- Console.print(str(Pi) + ", ");
- Console.print(str(Pi) + "\n");
- Console.println;
- i = 0;
- while (i < 10) {
- Console.print("ln("+i+") = ");
- Console.print(str(ln0.apply(i)) + ", ");
- Console.print(str(ln1.apply(i)) + ", ");
- Console.print(str(ln2.apply(i)) + "\n");
- i = i + 1;
- }
- Console.print("ln = ");
- Console.print(str(log(2)) + ", ");
- Console.print(str(log(2)) + ", ");
- Console.print(str(log(2)) + "\n");
- Console.println;
- }
-}
-
-//############################################################################
-
-object M2 {
-
- class IntIterator(start: Int) extends Iterator[Int] {
- var current: Int = start;
- def hasNext = true;
- def next = { current = current + 1; current - 1 };
- }
-
- class PrimeIterator() extends Iterator[Int] {
- var current: Iterator[Int] = new IntIterator(2);
- def hasNext = true;
- def next = {
- val p = current.next;
- current = current filter { x => !((x % p) == 0) };
- p
- }
- }
-
- def test = {
- val i = (new PrimeIterator()).take(30);
- Console.print("prime numbers:");
- while (i.hasNext) { Console.print(" " + i.next); }
- Console.println;
- }
-}
-
-//############################################################################
-
-object Test {
- def main(args: Array[String]): Unit = {
- M0.test;
- M1.test;
- M2.test;
- ()
- }
-}
-
-//############################################################################