-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix breaking change in MediaType.toString #334
Conversation
a0fa7f0
to
80fa8cf
Compare
Oh that's interesting ... what kind of errors do you see? Mima seems happy, but apparently there's more to compatibility ;) |
@@ -63,7 +63,7 @@ case class MediaType( | |||
|
|||
def isModel: Boolean = mainType.equalsIgnoreCase("model") | |||
|
|||
override lazy val toString: String = { | |||
private lazy val toStringCache: String = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you could add a comment explaining why this particular class has a toStringCache
field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Maybe it's binary-compatible because Scala will still generate the overriden
|
80fa8cf
to
9db38a3
Compare
Ah, makes sense, thanks :) @kciesielski didn't we add a similar optimization elsewhere recently? Maybe we need to add a similar work-around |
thx :) |
@adamw I did this to |
@kciesielski ah ... well it would be good to maintain source compat as well, so we'll need the same logic there as well, if you introduce the change |
Problem
#331 changed
MediaType.toString
to become alazy val
, which is a breaking change. I'm seeing this issue while trying to publish a version of Tapir with the optimizations mentioned in softwaremill/tapir#3552.Solution
Make the
lazy val
private and keep the sametoString()
interface as before.