summaryrefslogtreecommitdiff
path: root/test/files/presentation/patmat/src/PatMatTests.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/presentation/patmat/src/PatMatTests.scala')
-rw-r--r--test/files/presentation/patmat/src/PatMatTests.scala28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/files/presentation/patmat/src/PatMatTests.scala b/test/files/presentation/patmat/src/PatMatTests.scala
new file mode 100644
index 0000000000..bbd0f2e7ed
--- /dev/null
+++ b/test/files/presentation/patmat/src/PatMatTests.scala
@@ -0,0 +1,28 @@
+package patmat
+
+abstract class BaseType
+
+case class CaseOne(x: Int, y: List[Int]) extends BaseType
+case class CaseTwo(str: String) extends BaseType
+
+class PatMatTests {
+
+ def foo(x: BaseType) {
+ x match {
+ case CaseOne/*#*/(10, first :: second :: Nil) =>
+ val tmp = 23
+ println(first/*#*/)
+ println(tmp/*#*/)
+
+ case CaseTwo/*#*/(mystring) =>
+ println(mystring/*#*/)
+ }
+ }
+
+ def multipleAssign() {
+ val (x, y) = ("abc", "def")
+
+ println(x/*#*/, y/*#*/)
+ }
+
+} \ No newline at end of file