diff --git a/scalapb-runtime/src/main/scala/scalapb/GeneratedMessageCompanion.scala b/scalapb-runtime/src/main/scala/scalapb/GeneratedMessageCompanion.scala index 1ee5e5279..188c15dbe 100644 --- a/scalapb-runtime/src/main/scala/scalapb/GeneratedMessageCompanion.scala +++ b/scalapb-runtime/src/main/scala/scalapb/GeneratedMessageCompanion.scala @@ -43,7 +43,7 @@ trait UnrecognizedEnum extends GeneratedEnum { companion.scalaDescriptor.findValueByNumberCreatingIfUnknown(value) } -trait GeneratedEnumCompanion[A <: GeneratedEnum] { +trait GeneratedEnumCompanion[A <: GeneratedEnum] extends Any with Product with Serializable { type ValueType = A def fromValue(value: Int): A def fromName(name: String): Option[A] = values.find(_.name == name) @@ -67,7 +67,7 @@ trait GeneratedOneof extends Any with Product with Serializable { def valueOption: Option[ValueType] = if (isDefined) Some(value) else None } -trait GeneratedOneofCompanion +trait GeneratedOneofCompanion extends Any with Product with Serializable trait GeneratedMessage extends Any with Product with Serializable { @@ -160,7 +160,7 @@ trait JavaProtoSupport[ScalaPB, JavaPB] extends Any { def toJavaProto(scalaProto: ScalaPB): JavaPB } -trait GeneratedMessageCompanion[A <: GeneratedMessage] { +trait GeneratedMessageCompanion[A <: GeneratedMessage] extends Any with Product with Serializable { self => type ValueType = A