summaryrefslogtreecommitdiff
path: root/test/pending/pos
diff options
context:
space:
mode:
Diffstat (limited to 'test/pending/pos')
-rw-r--r--test/pending/pos/bug1957.scala38
-rw-r--r--test/pending/pos/bug2005.scala10
-rw-r--r--test/pending/pos/bug2018.scala15
-rw-r--r--test/pending/pos/bug2023.scala16
4 files changed, 79 insertions, 0 deletions
diff --git a/test/pending/pos/bug1957.scala b/test/pending/pos/bug1957.scala
new file mode 100644
index 0000000000..62800524eb
--- /dev/null
+++ b/test/pending/pos/bug1957.scala
@@ -0,0 +1,38 @@
+object Test {
+ abstract class Settings {}
+
+ abstract class Grist
+ { self =>
+ type settingsType <: Settings
+ type moduleType <: Module {type settingsType = self.settingsType}
+ val module: moduleType
+ }
+
+ abstract class Tool
+ { self =>
+ type settingsType <: Settings
+ type moduleType = Module { type settingsType = self.settingsType }
+ type gristType = Grist { type moduleType <: self.moduleType; type settingsType <: self.settingsType }
+
+ def inputGrist: List[gristType]
+ }
+
+ abstract class Module
+ { self =>
+ type settingsType <: Settings
+ final type commonModuleType = Module {type settingsType = self.settingsType}
+ type selfType >: self.type <: commonModuleType
+
+ // BTW: if we use the commented out type declarations, the code compiles successfully
+ // type gristType = Grist {type settingsType <: self.settingsType; type moduleType <: commonModuleType }
+
+ val tools: List[Tool {type settingsType = self.settingsType}]
+
+ protected def f: List[commonModuleType] =
+ {
+ val inputGrists = tools.flatMap(_.inputGrist) // val inputGrists: List[gristType] =
+ inputGrists.map(_.module)
+ }
+
+ }
+} \ No newline at end of file
diff --git a/test/pending/pos/bug2005.scala b/test/pending/pos/bug2005.scala
new file mode 100644
index 0000000000..24e79a2a33
--- /dev/null
+++ b/test/pending/pos/bug2005.scala
@@ -0,0 +1,10 @@
+object Bug {
+ def main(args: Array[String]) {
+ val a = new Array[Array[Int]](2,2)
+ test(a)
+ }
+ def test[A](t: Array[Array[A]]) {
+ val tmp = t(0)
+ t(1) = tmp
+ }
+} \ No newline at end of file
diff --git a/test/pending/pos/bug2018.scala b/test/pending/pos/bug2018.scala
new file mode 100644
index 0000000000..3e7e623b2a
--- /dev/null
+++ b/test/pending/pos/bug2018.scala
@@ -0,0 +1,15 @@
+class A {
+ val b = new B
+
+ def getChildren = List(new A).elements
+
+ class B {
+ private def check = true
+
+ private def getAncestor(p: A): A = {
+ val c = (p.getChildren.find(_.b.check)) match {case Some(d) => d case None => p}
+
+ if (c == p) p else c.b.getAncestor(c)
+ }
+ }
+} \ No newline at end of file
diff --git a/test/pending/pos/bug2023.scala b/test/pending/pos/bug2023.scala
new file mode 100644
index 0000000000..22ae76bdd7
--- /dev/null
+++ b/test/pending/pos/bug2023.scala
@@ -0,0 +1,16 @@
+trait C[A]
+
+object C {
+ implicit def ipl[A](implicit from: A => Ordered[A]): C[A] = null
+}
+
+object P {
+ def foo[A](i: A, j: A)(implicit c: C[A]): Unit = ()
+}
+
+class ImplicitChainTest {
+ def testTrivial: Unit = {
+ P.foo('0', '9')
+ P.foo('0', '9')
+ }
+} \ No newline at end of file