11/*
22 * scala-exercises - exercises-stdlib
3- * Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
3+ * Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
44 *
55 */
66
@@ -71,7 +71,7 @@ object Extractors extends FlatSpec with Matchers with org.scalaexercises.definit
7171 class Car (val make : String , val model : String , val year : Short , val topSpeed : Short )
7272
7373 object ChopShop {
74- def unapply (x : Car ) = Some (x.make, x.model, x.year, x.topSpeed)
74+ def unapply (x : Car ) = Some (( x.make, x.model, x.year, x.topSpeed) )
7575 }
7676
7777 val ChopShop (a, b, c, d) = new Car (" Chevy" , " Camaro" , 1978 , 120 )
@@ -88,7 +88,7 @@ object Extractors extends FlatSpec with Matchers with org.scalaexercises.definit
8888 class Car (val make : String , val model : String , val year : Short , val topSpeed : Short )
8989
9090 object ChopShop {
91- def unapply (x : Car ) = Some (x.make, x.model, x.year, x.topSpeed)
91+ def unapply (x : Car ) = Some (( x.make, x.model, x.year, x.topSpeed) )
9292 }
9393
9494 val x = new Car (" Chevy" , " Camaro" , 1978 , 120 ) match {
@@ -106,7 +106,7 @@ object Extractors extends FlatSpec with Matchers with org.scalaexercises.definit
106106 class Car (val make : String , val model : String , val year : Short , val topSpeed : Short )
107107
108108 object ChopShop {
109- def unapply (x : Car ) = Some (x.make, x.model, x.year, x.topSpeed)
109+ def unapply (x : Car ) = Some (( x.make, x.model, x.year, x.topSpeed) )
110110 }
111111
112112 val x = new Car (" Chevy" , " Camaro" , 1978 , 120 ) match {
@@ -125,9 +125,9 @@ object Extractors extends FlatSpec with Matchers with org.scalaexercises.definit
125125 class Employee (val firstName : String , val middleName : Option [String ], val lastName : String )
126126
127127 object Tokenizer {
128- def unapply (x : Car ) = Some (x.make, x.model, x.year, x.topSpeed)
128+ def unapply (x : Car ) = Some (( x.make, x.model, x.year, x.topSpeed) )
129129
130- def unapply (x : Employee ) = Some (x.firstName, x.lastName)
130+ def unapply (x : Employee ) = Some (( x.firstName, x.lastName) )
131131 }
132132
133133 val result = new Employee (" Kurt" , None , " Vonnegut" ) match {
@@ -142,7 +142,7 @@ object Extractors extends FlatSpec with Matchers with org.scalaexercises.definit
142142 */
143143 def anyObjectExtractors (res0 : String ) {
144144 class Car (val make : String , val model : String , val year : Short , val topSpeed : Short ) {
145- def unapply (x : Car ) = Some (x.make, x.model)
145+ def unapply (x : Car ) = Some (( x.make, x.model) )
146146 }
147147
148148 val camaro = new Car (" Chevy" , " Camaro" , 1978 , 122 )
@@ -168,7 +168,7 @@ object Extractors extends FlatSpec with Matchers with org.scalaexercises.definit
168168 // factory methods, extractors, apply
169169 // Extractor: Create tokens that represent your object
170170 def unapply (x : Employee ) =
171- Some (x.lastName, x.middleName, x.firstName)
171+ Some (( x.lastName, x.middleName, x.firstName) )
172172 }
173173
174174 val singri = new Employee (" Singri" , None , " Keerthi" )
@@ -193,7 +193,7 @@ object Extractors extends FlatSpec with Matchers with org.scalaexercises.definit
193193 // factory methods, extractors, apply
194194 // Extractor: Create tokens that represent your object
195195 def unapply (x : Employee ) =
196- Some (x.lastName, x.middleName, x.firstName)
196+ Some (( x.lastName, x.middleName, x.firstName) )
197197 }
198198
199199 val singri = new Employee (" Singri" , None , " Keerthi" )
0 commit comments