summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2010-07-19 14:33:30 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2010-07-19 14:33:30 +0000
commit5bef3feb67077264ce6f5abbf8fd235f5afe6a5d (patch)
tree2b246a69e8e3073001805396625cb46fbd6eb1f6 /test/files
parented2532a39ac94d889294bf1ee4c7e29b8cfc8178 (diff)
downloadscala-5bef3feb67077264ce6f5abbf8fd235f5afe6a5d.tar.gz
scala-5bef3feb67077264ce6f5abbf8fd235f5afe6a5d.tar.bz2
scala-5bef3feb67077264ce6f5abbf8fd235f5afe6a5d.zip
Merged revisions 22584,22587-22590 via svnmerge...
Merged revisions 22584,22587-22590 via svnmerge from https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk ........ r22584 | dubochet | 2010-07-18 17:59:14 +0200 (Sun, 18 Jul 2010) | 1 line [scaladoc] Print "Inherited from" headings using type instances ("SeqLike[A, List[A]]") instead of template names ("SeqLike"). Review by malayeri. ........ r22587 | dubochet | 2010-07-19 11:38:25 +0200 (Mon, 19 Jul 2010) | 1 line [scaladoc] Adds private Scaladoc option "-Yuse-stupid-types" for LAMP internal use. No review. ........ r22588 | dubochet | 2010-07-19 13:57:51 +0200 (Mon, 19 Jul 2010) | 1 line [scaladoc] Fixes an issue whereas inherited members in objects would not see their types instantiated properly. 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. ........
Diffstat (limited to 'test/files')
-rw-r--r--test/files/pos/t2133.scala18
-rwxr-xr-xtest/files/pos/t3174.scala14
-rwxr-xr-xtest/files/pos/t3174b.scala12
-rwxr-xr-xtest/files/pos/t3568.scala46
-rwxr-xr-xtest/files/run/weakconform.scala4
5 files changed, 94 insertions, 0 deletions
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/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)
+}