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
Just thinking out loud: the wart wouldn't necessarily need to be specific to 2.13 - although it might be useful to tailor error messages to something like:
For Scala <=2.12 you should use `Try(foo.toInt)`, for Scala >= 2.13 use `foo.toIntOption`
(or possibly for forwards-compatibility, suggest Try(foo.toInt).toOption for <=2.12?)
In a similar vein to
OptionPartial
andTryPartial
, we can check for non-total conversions fromString
to primitive types:Offending methods in
scala.collection.StringOps
aretoBoolean
,toByte
,toDouble
,toFloat
,toInt
,toLong
andtoShort
.Note that this wart would be specific to Scala 2.13, since that's when we got the
to*Option
syntax.The text was updated successfully, but these errors were encountered: