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/pos/t796.scala | |
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/pos/t796.scala')
-rw-r--r-- | test/pending/pos/t796.scala | 20 |
1 files changed, 20 insertions, 0 deletions
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 ) + } +} + |