Skip to content

Commit 5186edb

Browse files
paulpadriaanm
authored andcommitted
Make all numeric coercions explicit.
Optimistically, this is preparation for a day when we don't let numeric types drift with the winds. Even without the optimism it's a good idea. It flushed out an undocumented change in the math package object relative to the methods being forwarded (a type is widened from what is returned in java) so I documented the intentionality of it. Managing type coercions manually is a bit tedious, no doubt, but it's not tedious enough to warrant abandoning type safety just because java did it.
1 parent 039acc1 commit 5186edb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/library/scala/util/parsing/json/Parser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ object JSONFormat {
8383
* Per RFC4627, section 2.5, we're not technically required to
8484
* encode the C1 codes, but we do to be safe.
8585
*/
86-
case c if ((c >= '\u0000' && c <= '\u001f') || (c >= '\u007f' && c <= '\u009f')) => "\\u%04x".format(c: Int)
86+
case c if ((c >= '\u0000' && c <= '\u001f') || (c >= '\u007f' && c <= '\u009f')) => "\\u%04x".format(c.toInt)
8787
case c => c
8888
}.mkString
8989
}

0 commit comments

Comments
 (0)