You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem
Wrong use of 'let' scope function is given in the lesson. Instead of 'let' scope function there should be a 'with' scope function. fun printQuiz() { question1.let { println(it.questionText) println(it.answer) println(it.difficulty) } println() question2.let { println(it.questionText) println(it.answer) println(it.difficulty) } println() question3.let { println(it.questionText) println(it.answer) println(it.difficulty) } println() }
It should be : fun printQuiz() { with(question1) { println(questionText) println(answer) println(difficulty) } println() with(question2) { println(questionText) println(answer) println(difficulty) } println() with(question3) { println(questionText) println(answer) println(difficulty) } println() }
Name of the Codelab or Codelab URL
Describe the problem
Wrong use of 'let' scope function is given in the lesson. Instead of 'let' scope function there should be a 'with' scope function.
fun printQuiz() { question1.let { println(it.questionText) println(it.answer) println(it.difficulty) } println() question2.let { println(it.questionText) println(it.answer) println(it.difficulty) } println() question3.let { println(it.questionText) println(it.answer) println(it.difficulty) } println() }
It should be :
fun printQuiz() { with(question1) { println(questionText) println(answer) println(difficulty) } println() with(question2) { println(questionText) println(answer) println(difficulty) } println() with(question3) { println(questionText) println(answer) println(difficulty) } println() }
In which lesson and step of the codelab can this issue be found?
Generics, objects, and extensions + 8. Use scope functions to access class properties and methods
How to reproduce?
N/A - this is a content error
Versions
N/A - this is a content error
Additional information
N/A
codelab: basic-android-compose-training-add-scrollable-list
The text was updated successfully, but these errors were encountered: