Skip to content

Commit

Permalink
i_introduction/_3_Default_Arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Lotz committed Dec 25, 2017
1 parent d70e0fc commit 19b93dd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/i_introduction/_3_Default_Arguments/n03DefaultArguments.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ fun todoTask3(): Nothing = TODO(
documentation = doc2(),
references = { name: String -> JavaCode3().foo(name); foo(name) })

fun foo(name: String): String = todoTask3()
fun foo(name: String, number: Int = 42, toUpperCase: Boolean = false): String =
(if (toUpperCase) name.toUpperCase() else name) + number

fun task3(): String {
todoTask3()
// return (foo("a") +
// foo("b", number = 1) +
// foo("c", toUpperCase = true) +
// foo(name = "d", number = 2, toUpperCase = true))
return (foo("a") +
foo("b", number = 1) +
foo("c", toUpperCase = true) +
foo(name = "d", number = 2, toUpperCase = true))
}

0 comments on commit 19b93dd

Please sign in to comment.