File tree 3 files changed +10
-9
lines changed
compiler-plugin/src/main/scala/scalapb/compiler
scalapb-runtime/src/main/scala/scalapb
3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -67,9 +67,7 @@ lazy val runtime = (projectMatrix in file("scalapb-runtime"))
67
67
ProblemFilters .exclude[ReversedMissingMethodProblem ](" scalapb.GeneratedEnum.asRecognized" ),
68
68
ProblemFilters .exclude[InheritedNewAbstractMethodProblem ](" *Extension*" ),
69
69
ProblemFilters .exclude[Problem ](" scalapb.options.*" ),
70
- ProblemFilters .exclude[FinalMethodProblem ](" *.parseFrom" ),
71
- ProblemFilters .exclude[IncompatibleResultTypeProblem ](" scalapb.UnknownFieldSet#Builder.parseField" ),
72
- ProblemFilters .exclude[IncompatibleResultTypeProblem ](" scalapb.UnknownFieldSet#Field#Builder.parseField" ),
70
+ ProblemFilters .exclude[FinalMethodProblem ](" *.parseFrom" )
73
71
)
74
72
)
75
73
.jvmPlatform(
Original file line number Diff line number Diff line change @@ -213,15 +213,20 @@ private[compiler] class ParseFromGenerator(
213
213
} else p
214
214
}
215
215
.when(! message.preservesUnknownFields)(
216
- _.add(" case tag => _input__.skipField(tag): Unit" )
216
+ _.add(
217
+ """ | case tag =>
218
+ | _input__.skipField(tag): @_root_.scala.annotation.nowarn
219
+ | ()""" .stripMargin
220
+ )
217
221
)
218
222
.when(message.preservesUnknownFields)(
219
223
_.add(
220
224
""" case tag =>
221
225
| if (_unknownFields__ == null) {
222
226
| _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
223
227
| }
224
- | _unknownFields__.parseField(tag, _input__)""" .stripMargin
228
+ | _unknownFields__.parseField(tag, _input__): @_root_.scala.annotation.nowarn
229
+ | ()""" .stripMargin
225
230
)
226
231
)
227
232
.add(" }" )
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ object UnknownFieldSet {
89
89
lengthDelimited = lengthDelimited.result()
90
90
)
91
91
92
- def parseField (tag : Int , input : CodedInputStream ): this . type = {
92
+ def parseField (tag : Int , input : CodedInputStream ) = {
93
93
val wireType = WireType .getTagWireType(tag)
94
94
95
95
wireType match {
@@ -106,7 +106,6 @@ object UnknownFieldSet {
106
106
s " Protocol message tag had invalid wire type: ${wireType}"
107
107
)
108
108
}
109
- this
110
109
}
111
110
}
112
111
@@ -136,10 +135,9 @@ object UnknownFieldSet {
136
135
if (fieldBuilders.isEmpty) UnknownFieldSet .empty
137
136
else new UnknownFieldSet (fieldBuilders.view.mapValues(_.result()).toMap)
138
137
139
- def parseField (tag : Int , input : CodedInputStream ): this . type = {
138
+ def parseField (tag : Int , input : CodedInputStream ) = {
140
139
val fieldNumber = WireType .getTagFieldNumber(tag)
141
140
fieldBuilders.getOrElseUpdate(fieldNumber, new Field .Builder ()).parseField(tag, input)
142
- this
143
141
}
144
142
}
145
143
}
You can’t perform that action at this time.
0 commit comments