summaryrefslogtreecommitdiff
path: root/test/pending
diff options
context:
space:
mode:
authorLex Spoon <lex@lexspoon.org>2006-05-10 08:46:40 +0000
committerLex Spoon <lex@lexspoon.org>2006-05-10 08:46:40 +0000
commit8b8d0f844ce01b8b786798125815fdc61ae42b90 (patch)
treed255efc5673beaf1c07aed000b09e9dc8e117ab0 /test/pending
parent2c77b8a0af65d2beea520189232405ff60dc5406 (diff)
downloadscala-8b8d0f844ce01b8b786798125815fdc61ae42b90.tar.gz
scala-8b8d0f844ce01b8b786798125815fdc61ae42b90.tar.bz2
scala-8b8d0f844ce01b8b786798125815fdc61ae42b90.zip
Diffstat (limited to 'test/pending')
-rw-r--r--test/pending/pos/bug586.scala78
1 files changed, 78 insertions, 0 deletions
diff --git a/test/pending/pos/bug586.scala b/test/pending/pos/bug586.scala
new file mode 100644
index 0000000000..ca0a508baa
--- /dev/null
+++ b/test/pending/pos/bug586.scala
@@ -0,0 +1,78 @@
+import scala.collection.immutable.{Map, TreeMap, ListMap, ListSet, Set}
+import scala.collection.{immutable=>imm, mutable=>mut}
+
+case class HashTreeSet[A](map: imm.Map[A, Unit])
+extends Object
+with imm.Set[A]
+{
+ def this() = this(null)
+
+ def size = map.size
+ def +(elem: A) = new HashTreeSet(map + elem -> ())
+ def -(elem: A) = new HashTreeSet(map - elem)
+ def contains(elem: A) = map.isDefinedAt(elem)
+ def elements = map.elements.map(._1)
+ def empty:imm.Set[A] = new HashTreeSet[A]()
+}
+
+
+abstract class Goal2 {
+ type Question
+ val question: Question
+
+ type Answer
+ def initialAnswer: Answer
+}
+
+
+
+abstract class AbstractRespondersGoal
+extends Goal2 // TYPEFIX -- comment out the extends Goal2
+{
+}
+
+class RespondersGoal(
+ val question: String,
+ rcvr: String,
+ signature: String,
+ codebase: String)
+extends AbstractRespondersGoal
+{
+ type Question = String
+ type Answer = imm.Set[String]
+
+ val initialAnswer = new HashTreeSet[String]()// TYPEFIX .asInstanceOf[Answer]
+}
+
+
+class SingleResponderGoal(val question: String, responder: String)
+extends AbstractRespondersGoal
+{
+ type Question = String
+ type Answer = Set[String]
+ val initialAnswer = (new ListSet[String])//TYPEFIX .asInstanceOf[Answer]
+}
+
+class RespondersGoalSet
+//extends OneKindGoalSet
+{
+ type Question = String
+ type Answer = imm.Set[String]
+ type MyGoal = AbstractRespondersGoal
+
+ var selector: Boolean = _
+ def newGoal(question: String) //TYPEFIX :MyGoal
+ = {
+
+ selector match {
+// case StaticMethodSelector(method: MethodRef) =>
+ case true =>
+ new SingleResponderGoal(null, null)
+
+// case DynamicMethodSelector(signature: MethodSignature) => {
+case false => {
+ new RespondersGoal(null, null,null,null)
+ }
+ }
+ }
+}