summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2010-06-16 09:03:58 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2010-06-16 09:03:58 +0000
commit7023c8d727d5147ebed9c276069e58470e0bbe41 (patch)
tree1c0834bcdb614c7b12717d2412ff8593bc6c1a22 /test/files
parente0bb63d7a8ca354ba91e77dd042c69b2e0b1c339 (diff)
downloadscala-7023c8d727d5147ebed9c276069e58470e0bbe41.tar.gz
scala-7023c8d727d5147ebed9c276069e58470e0bbe41.tar.bz2
scala-7023c8d727d5147ebed9c276069e58470e0bbe41.zip
Propagation of r22303 for #3568
Diffstat (limited to 'test/files')
-rw-r--r--test/files/pos/bug3568.scala46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/files/pos/bug3568.scala b/test/files/pos/bug3568.scala
new file mode 100644
index 0000000000..7cfb927138
--- /dev/null
+++ b/test/files/pos/bug3568.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
+ }
+} \ No newline at end of file