diff options
author | David MacIver <david.maciver@gmail.com> | 2008-09-03 20:38:01 +0000 |
---|---|---|
committer | David MacIver <david.maciver@gmail.com> | 2008-09-03 20:38:01 +0000 |
commit | 1ed25d9dd0c9914b1a90baf178efd19bc0f0775d (patch) | |
tree | 7d6a9926a93822916b5e4f60f63b7405bc9b015e /test/pending | |
parent | 9ea23262bb21c890b08d91d177ec46fd1260031f (diff) | |
download | scala-1ed25d9dd0c9914b1a90baf178efd19bc0f0775d.tar.gz scala-1ed25d9dd0c9914b1a90baf178efd19bc0f0775d.tar.bz2 scala-1ed25d9dd0c9914b1a90baf178efd19bc0f0775d.zip |
More bugs from tickets added to pending.
Diffstat (limited to 'test/pending')
-rw-r--r-- | test/pending/pos/t1035.scala | 32 | ||||
-rw-r--r-- | test/pending/pos/t796.scala | 20 |
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 ) + } +} + |