You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _overviews/tutorials/binary-compatibility-for-library-authors.md
+50-8
Original file line number
Diff line number
Diff line change
@@ -182,21 +182,39 @@ To achieve that, follow this pattern:
182
182
* define a private `unapply` function in the companion object (note that by doing that the case class loses the ability to be used as an extractor in match expressions)
183
183
* for all the fields, define `withXXX` methods on the case class that create a new instance with the respective field changed (you can use the private `copy` method to implement them)
184
184
* create a public constructor by defining an `apply` method in the companion object (it can use the private constructor)
185
+
* in Scala 2, you have to add the compiler option `-Xsource:3`
@@ -239,8 +257,21 @@ Later in time, you can amend the original case class definition to, say, add an
239
257
* update the public `apply` method in the companion object to initialize all the fields,
240
258
* tell MiMa to [ignore](https://github.com/lightbend/mima#filtering-binary-incompatibilities) changes to the class constructor. This step is necessary because MiMa does not yet ignore changes in private class constructor signatures (see [#738](https://github.com/lightbend/mima/issues/738)).
0 commit comments