# A Kotlin lambda syntax pitfall that prevents animation updates

DevFeed: [A Kotlin lambda syntax pitfall that prevents animation updates](<https://devfeed.tech/articles/a-little-kotlin-puzzler-28670.md>)

Original publisher: [Read original article](<https://jeroenmols.com/blog/2018/09/25/kotlinpuzzler/>)

Author: info@jeroenmols.com (Jeroen Mols)

Published: 2018-09-25T00:00:00Z

Content type: tutorial

Language: en

Sources: [Jeroen Mols](<https://devfeed.tech/sources/jeroen-mols.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Programming language](<https://devfeed.tech/topics/programming-language.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [blogs](<https://devfeed.tech/tags/blogs.md>), [code](<https://devfeed.tech/tags/code.md>), [function](<https://devfeed.tech/tags/function.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [lambda](<https://devfeed.tech/tags/lambda.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [puzzle](<https://devfeed.tech/tags/puzzle.md>), [syntax](<https://devfeed.tech/tags/syntax.md>)

## AI overview

This Kotlin puzzle explains why a progress bar fails to animate: a lambda is registered instead of invoking the method that handles animation updates. Changing the syntax so the method is called fixes the behavior.

## Source excerpt

Kotlin is an incredibly enjoyable, concise and powerful programming language. Yet sometimes also a bit confusing... Puzzle # Have a look at the simple class below.