diff --git a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/AnotherException.scala b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/AnotherException.scala index ab85a6dd1..a03d0c3c7 100644 --- a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/AnotherException.scala +++ b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/AnotherException.scala @@ -155,7 +155,7 @@ object AnotherException extends ValidatingThriftStructCodec3[AnotherException] w errorCode ) - def unapply(_item: AnotherException): _root_.scala.Option[Int] = _root_.scala.Some(_item.errorCode) + def unapply(_item: AnotherException): _root_.scala.Some[Int] = _root_.scala.Some(_item.errorCode) diff --git a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/CollectionId.scala b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/CollectionId.scala index 321566067..25ee1d8a7 100644 --- a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/CollectionId.scala +++ b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/CollectionId.scala @@ -218,7 +218,7 @@ object CollectionId extends ValidatingThriftStructCodec3[CollectionId] with Stru collectionLongId ) - def unapply(_item: CollectionId): _root_.scala.Option[Long] = _root_.scala.Some(_item.collectionLongId) + def unapply(_item: CollectionId): _root_.scala.Some[Long] = _root_.scala.Some(_item.collectionLongId) diff --git a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/GoldService.scala b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/GoldService.scala index f51febc5e..1cdf32bc3 100644 --- a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/GoldService.scala +++ b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/GoldService.scala @@ -420,7 +420,7 @@ object GoldService extends _root_.com.twitter.finagle.thrift.GeneratedThriftServ request ) - def unapply(_item: Args): _root_.scala.Option[com.twitter.scrooge.test.gold.thriftscala.Request] = _root_.scala.Some(_item.request) + def unapply(_item: Args): _root_.scala.Some[com.twitter.scrooge.test.gold.thriftscala.Request] = _root_.scala.Some(_item.request) @@ -685,7 +685,7 @@ object GoldService extends _root_.com.twitter.finagle.thrift.GeneratedThriftServ ex ) - def unapply(_item: Result): _root_.scala.Option[_root_.scala.Tuple2[Option[com.twitter.scrooge.test.gold.thriftscala.Response], Option[com.twitter.scrooge.test.gold.thriftscala.OverCapacityException]]] = _root_.scala.Some(_item.toTuple) + def unapply(_item: Result): _root_.scala.Some[_root_.scala.Tuple2[Option[com.twitter.scrooge.test.gold.thriftscala.Response], Option[com.twitter.scrooge.test.gold.thriftscala.OverCapacityException]]] = _root_.scala.Some(_item.toTuple) @@ -966,7 +966,7 @@ object GoldService extends _root_.com.twitter.finagle.thrift.GeneratedThriftServ request ) - def unapply(_item: Args): _root_.scala.Option[com.twitter.scrooge.test.gold.thriftscala.Request] = _root_.scala.Some(_item.request) + def unapply(_item: Args): _root_.scala.Some[com.twitter.scrooge.test.gold.thriftscala.Request] = _root_.scala.Some(_item.request) @@ -1193,7 +1193,7 @@ object GoldService extends _root_.com.twitter.finagle.thrift.GeneratedThriftServ success ) - def unapply(_item: Result): _root_.scala.Option[_root_.scala.Option[com.twitter.scrooge.test.gold.thriftscala.Response]] = _root_.scala.Some(_item.success) + def unapply(_item: Result): _root_.scala.Some[_root_.scala.Option[com.twitter.scrooge.test.gold.thriftscala.Response]] = _root_.scala.Some(_item.success) diff --git a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/OverCapacityException.scala b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/OverCapacityException.scala index f9b33fad6..875332a5d 100644 --- a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/OverCapacityException.scala +++ b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/OverCapacityException.scala @@ -159,7 +159,7 @@ object OverCapacityException extends ValidatingThriftStructCodec3[OverCapacityEx chillTimeSeconds ) - def unapply(_item: OverCapacityException): _root_.scala.Option[Int] = _root_.scala.Some(_item.chillTimeSeconds) + def unapply(_item: OverCapacityException): _root_.scala.Some[Int] = _root_.scala.Some(_item.chillTimeSeconds) diff --git a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/PlatinumService.scala b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/PlatinumService.scala index d258a10d3..426b36eea 100644 --- a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/PlatinumService.scala +++ b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/PlatinumService.scala @@ -453,7 +453,7 @@ object PlatinumService extends _root_.com.twitter.finagle.thrift.GeneratedThrift request ) - def unapply(_item: Args): _root_.scala.Option[com.twitter.scrooge.test.gold.thriftscala.Request] = _root_.scala.Some(_item.request) + def unapply(_item: Args): _root_.scala.Some[com.twitter.scrooge.test.gold.thriftscala.Request] = _root_.scala.Some(_item.request) @@ -750,7 +750,7 @@ object PlatinumService extends _root_.com.twitter.finagle.thrift.GeneratedThrift oce ) - def unapply(_item: Result): _root_.scala.Option[_root_.scala.Tuple3[Option[Int], Option[com.twitter.scrooge.test.gold.thriftscala.AnotherException], Option[com.twitter.scrooge.test.gold.thriftscala.OverCapacityException]]] = _root_.scala.Some(_item.toTuple) + def unapply(_item: Result): _root_.scala.Some[_root_.scala.Tuple3[Option[Int], Option[com.twitter.scrooge.test.gold.thriftscala.AnotherException], Option[com.twitter.scrooge.test.gold.thriftscala.OverCapacityException]]] = _root_.scala.Some(_item.toTuple) diff --git a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/Recursive.scala b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/Recursive.scala index 23e7f27f4..90cbff37c 100644 --- a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/Recursive.scala +++ b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/Recursive.scala @@ -258,7 +258,7 @@ object Recursive extends ValidatingThriftStructCodec3[Recursive] with StructBuil recRequest ) - def unapply(_item: Recursive): _root_.scala.Option[_root_.scala.Tuple2[Long, Option[com.twitter.scrooge.test.gold.thriftscala.Request]]] = _root_.scala.Some(_item.toTuple) + def unapply(_item: Recursive): _root_.scala.Some[_root_.scala.Tuple2[Long, Option[com.twitter.scrooge.test.gold.thriftscala.Request]]] = _root_.scala.Some(_item.toTuple) diff --git a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/Request.scala b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/Request.scala index 819ab7fd0..1af830d65 100644 --- a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/Request.scala +++ b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/Request.scala @@ -810,7 +810,7 @@ object Request extends ValidatingThriftStructCodec3[Request] with StructBuilderF anInt8 ) - def unapply(_item: Request): _root_.scala.Option[_root_.scala.Tuple15[_root_.scala.collection.Seq[String], _root_.scala.collection.Set[Int], _root_.scala.collection.Map[Long, Long], Option[com.twitter.scrooge.test.gold.thriftscala.Request], _root_.scala.collection.Seq[com.twitter.scrooge.test.gold.thriftscala.Request], String, Option[Long], Option[Long], Option[Long], Option[Long], Option[Long], Option[com.twitter.scrooge.test.gold.thriftscala.Recursive], String, Option[Long], Option[Byte]]] = _root_.scala.Some(_item.toTuple) + def unapply(_item: Request): _root_.scala.Some[_root_.scala.Tuple15[_root_.scala.collection.Seq[String], _root_.scala.collection.Set[Int], _root_.scala.collection.Map[Long, Long], Option[com.twitter.scrooge.test.gold.thriftscala.Request], _root_.scala.collection.Seq[com.twitter.scrooge.test.gold.thriftscala.Request], String, Option[Long], Option[Long], Option[Long], Option[Long], Option[Long], Option[com.twitter.scrooge.test.gold.thriftscala.Recursive], String, Option[Long], Option[Byte]]] = _root_.scala.Some(_item.toTuple) private[thriftscala] def readAListValue(_iprot: TProtocol): _root_.scala.collection.Seq[String] = { diff --git a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/Response.scala b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/Response.scala index fe2d468bc..e0639b854 100644 --- a/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/Response.scala +++ b/scrooge-generator-tests/src/test/resources/gold_file_output_scala/com/twitter/scrooge/test/gold/thriftscala/Response.scala @@ -258,7 +258,7 @@ object Response extends ValidatingThriftStructCodec3[Response] with StructBuilde responseUnion ) - def unapply(_item: Response): _root_.scala.Option[_root_.scala.Tuple2[Int, com.twitter.scrooge.test.gold.thriftscala.ResponseUnion]] = _root_.scala.Some(_item.toTuple) + def unapply(_item: Response): _root_.scala.Some[_root_.scala.Tuple2[Int, com.twitter.scrooge.test.gold.thriftscala.ResponseUnion]] = _root_.scala.Some(_item.toTuple) diff --git a/scrooge-generator/src/main/resources/scalagen/struct.mustache b/scrooge-generator/src/main/resources/scalagen/struct.mustache index b0e63e905..fb3263e62 100644 --- a/scrooge-generator/src/main/resources/scalagen/struct.mustache +++ b/scrooge-generator/src/main/resources/scalagen/struct.mustache @@ -376,10 +376,10 @@ object {{StructName}} extends ValidatingThriftStructCodec3[{{StructName}}] with def unapply(_item: {{StructName}}): Boolean = true {{/arity0}} {{#arity1}} - def unapply(_item: {{StructName}}): _root_.scala.Option[{{>optionalType}}] = _root_.scala.Some(_item.{{fieldName}}) + def unapply(_item: {{StructName}}): _root_.scala.Some[{{>optionalType}}] = _root_.scala.Some(_item.{{fieldName}}) {{/arity1}} {{#arityN}} - def unapply(_item: {{StructName}}): _root_.scala.Option[{{tuple}}] = _root_.scala.Some(_item.toTuple) + def unapply(_item: {{StructName}}): _root_.scala.Some[{{tuple}}] = _root_.scala.Some(_item.toTuple) {{/arityN}}