Skip to content

Commit 6a0f9e7

Browse files
aecantp7nov
andauthored
fix: indentation in safe.md (#2741)
* fix: indentation in safe.md * Update safe.md Co-authored-by: Pavel Semyonov <[email protected]>
1 parent 6464d2b commit 6a0f9e7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kotlin-features/safe.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ fun main() {
1212
// println(message.uppercase()) // This line doesn't compile
1313
println(message?.replace("fine", "okay")) // Access a nullable value in a safe manner
1414
if (message != null) { // If you check that the type is right,
15-
println(message.uppercase()) // the compiler will smart-cast it for you
16-
}
15+
println(message.uppercase()) // the compiler will smart-cast it for you
16+
}
1717

18-
val nonNull: String = // If the null-case throws an error,
18+
val nonNull: String = // If the null-case throws an error,
1919
reply(condition = true) ?: error() // Kotlin can infer that the result is non-null
2020
println(nonNull)
2121
}

0 commit comments

Comments
 (0)