diff options
author | Martin Odersky <odersky@gmail.com> | 2006-05-31 09:47:38 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-05-31 09:47:38 +0000 |
commit | 23904f63552d7cb98865d5a07101e2e9795d2ad1 (patch) | |
tree | 897cd8dfd243c5921570ebd1c091c111cf146d5a /test | |
parent | cab784ad14708b1c2b95d8af44b20f802667e7b2 (diff) | |
download | scala-23904f63552d7cb98865d5a07101e2e9795d2ad1.tar.gz scala-23904f63552d7cb98865d5a07101e2e9795d2ad1.tar.bz2 scala-23904f63552d7cb98865d5a07101e2e9795d2ad1.zip |
fixed bugs 616, 617
Diffstat (limited to 'test')
-rwxr-xr-x | test/files/neg/bug126.scala | 8 | ||||
-rwxr-xr-x | test/files/pos/bug122.scala | 4 | ||||
-rw-r--r-- | test/files/pos/bug616.scala | 11 | ||||
-rw-r--r-- | test/files/run/bug216.scala | 7 | ||||
-rw-r--r-- | test/files/run/lisp.scala | 14 | ||||
-rwxr-xr-x | test/pending/pos/bug305.scala | 8 | ||||
-rw-r--r-- | test/pending/pos/bug599.scala | 18 |
7 files changed, 62 insertions, 8 deletions
diff --git a/test/files/neg/bug126.scala b/test/files/neg/bug126.scala new file mode 100755 index 0000000000..75c10e608a --- /dev/null +++ b/test/files/neg/bug126.scala @@ -0,0 +1,8 @@ +class O { + val Bar:Any => Any = ((x:Any) => Bar(x)); + val Tuple2(foo:(Any => Any), bar) = Tuple2((x:Any) => foo(x), 1); + { + val Tuple1(foo2:(Any => Any)) = Tuple1((x:Any) => foo2(x)); + Console.println(foo2) + } +} diff --git a/test/files/pos/bug122.scala b/test/files/pos/bug122.scala new file mode 100755 index 0000000000..cbfdb64def --- /dev/null +++ b/test/files/pos/bug122.scala @@ -0,0 +1,4 @@ +class L{ + val List(v:int,2) = List(2,v:int); + val Pair(a:int,b:int) = Pair(1,a); +}
\ No newline at end of file diff --git a/test/files/pos/bug616.scala b/test/files/pos/bug616.scala new file mode 100644 index 0000000000..bf757a58d3 --- /dev/null +++ b/test/files/pos/bug616.scala @@ -0,0 +1,11 @@ +object testImplicit { + implicit def foo2bar(foo :Foo) :Bar = foo.bar + class Foo(val bar :Bar) { + def testCoercion = {val a = this; a.baz} // here, foo2bar is inferred by the compiler, as expected + //def testCoercionThisImplicit = baz // --> error: not found: value baz + def testCoercionThisExplicit: Any = this.baz // --> error: value baz is not a member of Foo + } + trait Bar { def baz :unit} +} +// mentioned before: http://thread.gmane.org/gmane.comp.lang.scala/2038, +// but couldn't find a bug report diff --git a/test/files/run/bug216.scala b/test/files/run/bug216.scala new file mode 100644 index 0000000000..41b2af7b50 --- /dev/null +++ b/test/files/run/bug216.scala @@ -0,0 +1,7 @@ +object Test extends Application { + object m { + val f = x: unit => (); + Console.println("OK") + } + m; +} diff --git a/test/files/run/lisp.scala b/test/files/run/lisp.scala index 34c4e7c7cc..cb26972e2d 100644 --- a/test/files/run/lisp.scala +++ b/test/files/run/lisp.scala @@ -15,14 +15,12 @@ class LispTokenizer(s: String) extends Iterator[String] { } def next: String = if (hasNext) { - val start = i; - var ch = s.charAt(i); i = i + 1; - if (ch == '(') "(" - else if (ch == ')') ")" - else { - while (i < s.length() && !isDelimiter(s.charAt(i))){ i = i + 1 } - s.substring(start, i) - } + val start = i + if (isDelimiter(s charAt i)) i = i + 1 + else + do i = i + 1 + while (!isDelimiter(s charAt i)) + s.substring(start, i) } else error("premature end of string") } diff --git a/test/pending/pos/bug305.scala b/test/pending/pos/bug305.scala new file mode 100755 index 0000000000..3e7e8c60f4 --- /dev/null +++ b/test/pending/pos/bug305.scala @@ -0,0 +1,8 @@ +object Test extends Application { + + def foo(is:int*) = 1; + def foo(i:int) = 2; + + Console.println( foo( List(3):_* ) ) + +}
\ No newline at end of file diff --git a/test/pending/pos/bug599.scala b/test/pending/pos/bug599.scala new file mode 100644 index 0000000000..885159af66 --- /dev/null +++ b/test/pending/pos/bug599.scala @@ -0,0 +1,18 @@ +abstract class FooA { + type A <: Ax; + abstract class Ax; + abstract class InnerA { + type B <: A; + def doB : B; + } + } + trait FooB extends FooA { + type A <: Ax; + trait Ax extends super.Ax { def xxx : Int; } + abstract class InnerB extends InnerA { + // type B <: A; + val a : A = doB; + a.xxx; + doB.xxx; + } + } |