Jakub Gwóźdź
12/02/2022, 7:51 AMJohann Pardanaud
12/02/2022, 8:01 AM123L
https://kotlinlang.org/docs/numbers.html#literal-constants-for-numbersephemient
12/02/2022, 8:06 AMInt
or a Long
ephemient
12/02/2022, 8:07 AMephemient
12/02/2022, 8:08 AMsumOf
for as long as it has existed, https://youtrack.jetbrains.com/issue/KT-46360Jakub Gwóźdź
12/02/2022, 8:09 AMephemient
12/02/2022, 8:11 AMephemient
12/02/2022, 8:12 AM0.toInt()
instead of as Int
to force the type, but the KTIJ plugin will (falsely) show that as unnecessary too 😞Jakub Gwóźdź
12/02/2022, 8:13 AMephemient
12/02/2022, 8:14 AMJakub Gwóźdź
12/02/2022, 8:19 AM❯ ./gradlew clean build
> Task :compileKotlin
w: /Users/jakub.gwozdz/personal/advent-of-code-2022/src/main/kotlin/day2/Day2.kt: (33, 11): No cast needed
w: /Users/jakub.gwozdz/personal/advent-of-code-2022/src/main/kotlin/day2/Day2.kt: (49, 11): No cast needed
🙂ephemient
12/02/2022, 8:20 AM@Suppress("USELESS_CAST")
will stop that from showing upJakub Gwóźdź
12/02/2022, 8:26 AMKlitos Kyriacou
12/02/2022, 2:55 PMlineSequence().count { it == "one" }
?Jakub Gwóźdź
12/02/2022, 2:56 PMfoo()
example 🙂