diff options
author | Antonio Cunei <antonio.cunei@epfl.ch> | 2010-09-02 11:54:06 +0000 |
---|---|---|
committer | Antonio Cunei <antonio.cunei@epfl.ch> | 2010-09-02 11:54:06 +0000 |
commit | 918fb944b611ee08b5f5596c2fbc5123d2f09917 (patch) | |
tree | b16a64b472f021b0f169ebf688b65f8492943691 /test/files | |
parent | 13387444da947f6a9fa3770ec2acb227333da6cf (diff) | |
download | scala-918fb944b611ee08b5f5596c2fbc5123d2f09917.tar.gz scala-918fb944b611ee08b5f5596c2fbc5123d2f09917.tar.bz2 scala-918fb944b611ee08b5f5596c2fbc5123d2f09917.zip |
Merged revisions 22108,22176-22177,22318,22589-...
Merged revisions
22108,22176-22177,22318,22589-22590,22595,22644,22657-22658,22723,22725,
22737-22738,22833-22835,22846,22858-22860,22872 via svnmerge from
https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk
........
r22108 | odersky | 2010-05-31 19:23:38 +0200 (Mon, 31 May 2010) | 1 line
made hashset more robust for concurrent access to reduce eclipse race
conditions. ........ r22176 | odersky | 2010-06-06 09:46:43 +0200 (Sun,
06 Jun 2010) | 2 lines
Overwrote copyToArray for efficiency.
........
r22177 | odersky | 2010-06-06 09:47:21 +0200 (Sun, 06 Jun 2010) | 2 lines
Fixed a typo in a use case
........
r22318 | odersky | 2010-06-16 17:36:08 +0200 (Wed, 16 Jun 2010) | 1 line
Imporved printing of private[C] in TreePrinters. No review. ........
r22589 | odersky | 2010-07-19 15:55:09 +0200 (Mon, 19 Jul 2010) | 1 line
new test files.
........
r22590 | odersky | 2010-07-19 15:56:03 +0200 (Mon, 19 Jul 2010) | 1 line
Added `ask` method to compiler control to do fast trunaround
computations on presentation compiler thread. ........ r22595 | odersky
| 2010-07-19 17:19:45 +0200 (Mon, 19 Jul 2010) | 1 line
added missing file.
........
r22644 | odersky | 2010-07-28 18:33:16 +0200 (Wed, 28 Jul 2010) | 1 line
Fixes #3679. Review by milessabin.
........
r22657 | odersky | 2010-08-02 15:53:16 +0200 (Mon, 02 Aug 2010) | 1 line
Revamped ScalaConversions. Fixes #3688. Also added JavaConverters
object which allows for explicit asJava/asScala conversions in the
scalaj style. Review by milessabin. ........ r22658 | odersky |
2010-08-02 15:53:58 +0200 (Mon, 02 Aug 2010) | 1 line
Fixed some typoes/errors in doc comments. No review. ........ r22723 |
odersky | 2010-08-10 17:47:15 +0200 (Tue, 10 Aug 2010) | 1 line
Removed duplicate classes. No review.
........
r22725 | odersky | 2010-08-10 19:38:32 +0200 (Tue, 10 Aug 2010) | 1 line
Added missing file for last checkin.
........
r22737 | odersky | 2010-08-12 11:02:46 +0200 (Thu, 12 Aug 2010) | 1 line
Changes in docs and layout. No review.
........
r22738 | odersky | 2010-08-12 11:03:30 +0200 (Thu, 12 Aug 2010) | 1 line
Fixed type soundness problem someone raised on hackers news. Test in
override.scala. Review by moors. ........ r22833 | odersky | 2010-08-24
16:59:13 +0200 (Tue, 24 Aug 2010) | 1 line
Fixes #3780. No review.
........
r22834 | odersky | 2010-08-24 16:59:54 +0200 (Tue, 24 Aug 2010) | 1 line
new tests. No review.
........
r22835 | odersky | 2010-08-24 17:48:09 +0200 (Tue, 24 Aug 2010) | 1 line
Closes #3776. No review.
........
r22846 | moors | 2010-08-26 18:16:54 +0200 (Thu, 26 Aug 2010) | 1 line
this should fix our achy breaky build. no review
........
r22858 | odersky | 2010-08-30 17:56:13 +0200 (Mon, 30 Aug 2010) | 1 line
added doc comment which makes things clearer when seen from Map or
Set. ........ r22859 | odersky | 2010-08-30 17:59:05 +0200 (Mon, 30 Aug
2010) | 1 line
removed author attribution, since no code from Stepan remains here.
........ r22860 | odersky | 2010-08-30 18:02:34 +0200 (Mon, 30 Aug 2010)
| 1 line
New wider interface of presentation compiler. Allows for partial
responses and improves cancelling. See Response.scala for a usage
example. ........ r22872 | odersky | 2010-08-31 17:37:55 +0200 (Tue, 31
Aug 2010) | 1 line
Partial fix for #3774. The crash is gone but the program is rejected.
A full fix will have to wait until a re-implementation of LUB/GLB along
the lines of the DOT system. ........
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/override.check | 5 | ||||
-rwxr-xr-x | test/files/neg/override.scala | 15 | ||||
-rw-r--r-- | test/files/neg/t3774.check | 7 | ||||
-rw-r--r-- | test/files/neg/t3774.scala | 5 | ||||
-rw-r--r-- | test/files/neg/t3776.check | 4 | ||||
-rw-r--r-- | test/files/neg/t3776.scala | 10 | ||||
-rw-r--r-- | test/files/pos/t2133.scala | 18 | ||||
-rwxr-xr-x | test/files/pos/t3174.scala | 14 | ||||
-rwxr-xr-x | test/files/pos/t3174b.scala | 12 | ||||
-rwxr-xr-x | test/files/pos/t3568.scala | 46 | ||||
-rw-r--r-- | test/files/pos/t3688.scala | 9 | ||||
-rw-r--r-- | test/files/run/t3763.scala | 3 | ||||
-rwxr-xr-x | test/files/run/weakconform.scala | 4 |
13 files changed, 152 insertions, 0 deletions
diff --git a/test/files/neg/override.check b/test/files/neg/override.check new file mode 100644 index 0000000000..0336fb2b11 --- /dev/null +++ b/test/files/neg/override.check @@ -0,0 +1,5 @@ +override.scala:9: error: overriding type T in trait A with bounds >: Int <: Int; + type T in trait B with bounds >: String <: String has incompatible type + lazy val x : A with B = x + ^ +one error found diff --git a/test/files/neg/override.scala b/test/files/neg/override.scala new file mode 100755 index 0000000000..764b06603a --- /dev/null +++ b/test/files/neg/override.scala @@ -0,0 +1,15 @@ +trait X { + trait A { type T >: Int <: Int } + val x : A + var n : x.T = 3 +} + +trait Y extends X { + trait B { type T >: String <: String } + lazy val x : A with B = x + n = "foo" +} + +object Test extends Application { + new Y {} +} diff --git a/test/files/neg/t3774.check b/test/files/neg/t3774.check new file mode 100644 index 0000000000..d73166bff9 --- /dev/null +++ b/test/files/neg/t3774.check @@ -0,0 +1,7 @@ +t3774.scala:4: error: overloaded method value ++ with alternatives: + [B1 >: List[Int]](xs: scala.collection.TraversableOnce[((Int, Int), B1)])scala.collection.immutable.Map[(Int, Int),B1] <and> + [B >: ((Int, Int), List[Int]),That](that: scala.collection.TraversableOnce[B])(implicit bf: scala.collection.generic.CanBuildFrom[scala.collection.immutable.Map[(Int, Int),List[Int]],B,That])That + cannot be applied to (scala.collection.immutable.IndexedSeq[((Int, Int), scala.collection.immutable.Range.Inclusive)]) + Map[(Int,Int),List[Int]]() ++ (for(x <- 0 to 1 ; y <- 0 to 1) yield {(x,y)-> (0 to 1)}) + ^ +one error found diff --git a/test/files/neg/t3774.scala b/test/files/neg/t3774.scala new file mode 100644 index 0000000000..2869925b01 --- /dev/null +++ b/test/files/neg/t3774.scala @@ -0,0 +1,5 @@ +// This used to hang the lub process. Now it rejects the file. This is still not correct, +// but we can solve this only after a redesign of lub a la dot. +object Hang { + Map[(Int,Int),List[Int]]() ++ (for(x <- 0 to 1 ; y <- 0 to 1) yield {(x,y)-> (0 to 1)}) +} diff --git a/test/files/neg/t3776.check b/test/files/neg/t3776.check new file mode 100644 index 0000000000..e8798df6f3 --- /dev/null +++ b/test/files/neg/t3776.check @@ -0,0 +1,4 @@ +t3776.scala:8: error: value someOperation is not a member of _$1 + def parsedAs[T](v: T) = MyParser.parse(pattern, a).get someOperation v + ^ +one error found diff --git a/test/files/neg/t3776.scala b/test/files/neg/t3776.scala new file mode 100644 index 0000000000..6e368165aa --- /dev/null +++ b/test/files/neg/t3776.scala @@ -0,0 +1,10 @@ +import util.parsing.combinator.{PackratParsers, RegexParsers} + +object MyParser extends RegexParsers with PackratParsers { +} + +object Test { + class ParsedAs(a: String) (implicit pattern: MyParser.Parser[_]) { + def parsedAs[T](v: T) = MyParser.parse(pattern, a).get someOperation v + } +} diff --git a/test/files/pos/t2133.scala b/test/files/pos/t2133.scala new file mode 100644 index 0000000000..c74d0a4bbf --- /dev/null +++ b/test/files/pos/t2133.scala @@ -0,0 +1,18 @@ +trait Foo { + object bar { + private[this] def fn() = 5 + } +} + +trait Foo2 { + object bip { + def fn() = 10 + } +} + +class Bob extends AnyRef with Foo with Foo2 { + import bip._ + import bar._ + + def go() = fn() +} diff --git a/test/files/pos/t3174.scala b/test/files/pos/t3174.scala new file mode 100755 index 0000000000..c3d90a4946 --- /dev/null +++ b/test/files/pos/t3174.scala @@ -0,0 +1,14 @@ +object test { + def method() { + class Foo extends AnyRef { + object Color { + object Blue + } + + class Board { + val grid = Color.Blue + } + } + new Foo + } + } diff --git a/test/files/pos/t3174b.scala b/test/files/pos/t3174b.scala new file mode 100755 index 0000000000..4df1bfe837 --- /dev/null +++ b/test/files/pos/t3174b.scala @@ -0,0 +1,12 @@ +trait Foo[X] { def foo : Map[String,Foo[X]] } + +object Test { + def f[T]() : Foo[T] = { + class Anon extends Foo[T] { + var foo: Map[String, Foo[T]] = Map[String,Foo[T]]() + //def foo = Map[String,Foo[T]]() + //def foo_=(x: Map[String,Foo[T]]) {} + } + new Anon + } +} diff --git a/test/files/pos/t3568.scala b/test/files/pos/t3568.scala new file mode 100755 index 0000000000..c8e3fcc4be --- /dev/null +++ b/test/files/pos/t3568.scala @@ -0,0 +1,46 @@ +import scala.annotation._ +import scala.annotation.unchecked._ +import scala.collection._ + + +package object buffer { + val broken = new ArrayVec2() // commenting out this line causes the file to compile. + + val works = Class.forName("buffer.ArrayVec2").newInstance().asInstanceOf[ArrayVec2] +} + +package buffer { + object Main { + // ArrayVec2 can be compiled, instantiated and used. + def main(args: Array[String]) { println(works) } + } + + trait ElemType { type Element; type Component <: ElemType } + trait Float1 extends ElemType { type Element = Float; type Component = Float1} + class Vec2 extends ElemType { type Element = Vec2; type Component = Float1 } + + abstract class BaseSeq[T <: ElemType, E] + extends IndexedSeq[E] with IndexedSeqOptimized[E, IndexedSeq[E]] { + def length = 1 + def apply(i: Int) :E + } + + abstract class GenericSeq[T <: ElemType] extends BaseSeq[T, T#Element] + trait DataArray[T <: ElemType] extends BaseSeq[T, T#Element] + trait DataView[T <: ElemType] extends BaseSeq[T, T#Element] + abstract class BaseFloat1 extends BaseSeq[Float1, Float] + + class ArrayFloat1 extends BaseFloat1 with DataArray[Float1] { + def apply(i: Int) :Float = 0f + } + + class ViewFloat1 extends BaseFloat1 with DataView[Float1] { + def apply(i: Int) :Float = 0f + } + + class ArrayVec2(val backingSeq: ArrayFloat1) + extends GenericSeq[Vec2] with DataArray[Vec2] { + def this() = this(new ArrayFloat1) + def apply(i: Int) :Vec2 = null + } +} diff --git a/test/files/pos/t3688.scala b/test/files/pos/t3688.scala new file mode 100644 index 0000000000..0ac1cfe514 --- /dev/null +++ b/test/files/pos/t3688.scala @@ -0,0 +1,9 @@ +import collection.mutable +import collection.JavaConversions._ +import java.{util => ju} + +object Test { + + implicitly[mutable.Map[Int, String] => ju.Dictionary[Int, String]] + +} diff --git a/test/files/run/t3763.scala b/test/files/run/t3763.scala new file mode 100644 index 0000000000..c8462b7437 --- /dev/null +++ b/test/files/run/t3763.scala @@ -0,0 +1,3 @@ +object Test extends Application { + val x = Array(Array(1), List(1)) +} diff --git a/test/files/run/weakconform.scala b/test/files/run/weakconform.scala new file mode 100755 index 0000000000..1ea81c9f64 --- /dev/null +++ b/test/files/run/weakconform.scala @@ -0,0 +1,4 @@ +object Test extends Application { + val x: Float = 10/3 + assert(x == 3.0) +} |