Susan Harkins (297) [Avatar] Offline
Please post errors in the published version of Kotlin in Action here. If necessary, we'll publish a comprehensive list for everyone's convenience. Thank you!

Susan Harkins
Errata Editor
Manning Publications
438572 (1) [Avatar] Offline

Could you please answer whether it is an errata?
474431 (2) [Avatar] Offline
Page 140:
Now that you’ve seen the Kotlin way to perform “if not-null” checks, let’s talk about the Kotlin safe version of instanceof checks: the safe-cast operator that often appears together with safe calls and Elvis operators.

The word "of" right before "instanceof" should have regular font, not fixed-width font as "instanceof".
474431 (2) [Avatar] Offline
ewilligers (31) [Avatar] Offline
Listing 3.3. Declaring joinToString() as a top-level function
3.2.3 Getting rid of static utility classes: top-level functions and properties

The code appears twice:-

package strings
fun joinToString(...): String { ... }

package strings

fun joinToString(...): String { ... }
ewilligers (31) [Avatar] Offline
6.1.9 Extensions for nullable types
mentions "isEmptyOrNull and isBlankOrNull".

isNullOrBlank and isNullOrEmpty are the correct names.
471252 (3) [Avatar] Offline
Page 48, the second line from bottom:

joinToString(list, suffix = ";", prefix = "# ")

"suffix" should be "postfix"
Mark Elston (121) [Avatar] Offline
Figure 9.8 shows Animal inheriting from Cat. This should be reversed.
Frank Schmitt (5) [Avatar] Offline
Probably not exactly an erratum, but listing 7.11 contains this:

operator fun Rectangle.contains(p: Point): Boolean {
    return p.x in upperLeft.x until lowerRight.x &&
           p.y in upperLeft.y until lowerRight.y

>>> val rect = Rectangle(Point(10, 20), Point(50, 50))
>>> println(Point(20, 30) in rect)
>>> println(Point(5, 5) in rect)

I initially thought that the condition for y (
p.y in upperLeft.y until lowerRight.y
) was wrong (it should be the other way round).

But now I guess that the example assumes a coordinate system where the origin is in the upper left corner and x increases from left to right and y from top to bottom. As far as I can tell, this is never explained (but it should be at least mentioned).
521344 (1) [Avatar] Offline
Code error in 5.2.1 :

val maxAge = people.maxBy(Person::age).age

The maxBy funtion returns a nullable object, code shoud be replaced by

val maxAge = people.maxBy(Person::age)!!.age
439501 (1) [Avatar] Offline

There seems to be a missing curly brace at the end of line 8 in Listing 3.4 (page 54) when starting the for loop.

Kind regards
asheshb (1) [Avatar] Offline
On Page 158 (PDF)

This is useful when you override a function that returns a generic parameter and make it return a value of the Unit type

I think returns a generic parameter is slightly confusing. returns the generic parameter makes more sense.