-
Notifications
You must be signed in to change notification settings - Fork 81
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
Don't call toString on null values #550
Conversation
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.
Oof!
For Scala 2 we use pprint, so this is not an issue. I wonder if we should actually switch to it for Scala 3 too, but Martin was highly against it. |
do you have a link to the arguments? pprint in mdoc is unpopular in the cats-effect IO codebases as it deconstructs everything, but I haven't read anything in relation to Scala 3 |
I think that was discussed in an email, but basically he was against it because this might surprise users, since it worked differently to We could have an additional setting when to use |
out.append(nullableToString(value).replace("\n","")) | ||
} | ||
|
||
inline private def nullableToString[T](value: T) = { |
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.
I believe this can be replaced with String.valueOf or an interpolated 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.
I think that would be equivalent. I can change it later on when doing some work around it. Or do you think this might work more correctly?
Connected to scalameta/metals#3054