google-developer-training / kotlin-bootcamp

Report issues with the Kotlin Bootcamp for Programmers codelab
7 stars 2 forks source link

Lesson 1.2 Kotlin Basics issue: Assignment type mismatch #225

Open hassaneldash opened 3 months ago

hassaneldash commented 3 months ago

var fishFoodTreats = 6 fishFoodTreats = fishFoodTreats?.dec()

Kotlin: Assignment type mismatch: actual type is 'kotlin/Int?' but 'kotlin/Int' was expected

It must be var fishFoodTreats :Int? = 6 fishFoodTreats = fishFoodTreats?.dec()