summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/pending/pos/t1035.scala32
-rw-r--r--test/pending/pos/t796.scala20
2 files changed, 52 insertions, 0 deletions
diff --git a/test/pending/pos/t1035.scala b/test/pending/pos/t1035.scala
new file mode 100644
index 0000000000..2e2f911bc4
--- /dev/null
+++ b/test/pending/pos/t1035.scala
@@ -0,0 +1,32 @@
+//A fatal error or Scala compiler
+// Scala compiler version 2.7.1-final -- (c) 2002-2007 LAMP/EPFL
+// Carlos Loria cloria@artinsoft.com
+// 7/10/2008
+
+class A {
+ var name:String = _
+ def getName() = name
+ def this(name:String, age:Int){this();this.name=name}
+
+}
+
+class B(name:String) extends A(name,0){
+}
+
+class D {
+
+ object A {
+ def unapply(p:A) = Some(p.getName)
+ }
+
+ object B {
+ def unapply(p:B) = Some(p.getName)
+ }
+ def foo(p:Any) = p match {
+ case B(n) => println("B")
+ case A(n) => println("A")
+
+
+ }
+
+} \ No newline at end of file
diff --git a/test/pending/pos/t796.scala b/test/pending/pos/t796.scala
new file mode 100644
index 0000000000..c013f49686
--- /dev/null
+++ b/test/pending/pos/t796.scala
@@ -0,0 +1,20 @@
+case class CaseClass( value: Int );
+
+object PatternMatchBug {
+ def matcher( a: AnyRef, b: Any ) {
+ (a, b) match {
+ case ( instance: CaseClass, instance.value ) =>
+ System.out.println( "Match succeeded!" );
+ case _ =>
+ System.out.println( "Match failed!" );
+ }
+ }
+
+ def main( args : Array[String] ) {
+ val caseClassInstance = CaseClass( 42 )
+
+ matcher( caseClassInstance, 13 )
+ matcher( caseClassInstance, 42 )
+ }
+}
+