kotlin-koans icon indicating copy to clipboard operation
kotlin-koans copied to clipboard

Task 32 java.lang.NoSuchMethodError: when we have Int property

Open AlexStankevich opened this issue 6 years ago • 0 comments

When I use nonNull Int for propertyWithCounter test fails with java.lang.NoSuchMethodError.

var propertyWithCounter: Int = 0
        set(value) {
            field = value
            counter++
        }

But when I use var propertyWithCounter: Int? = null -- all OK Why it happens?

Reproduced only in Android Studio 1.3.4 with Kotlin plugin 1.2.61. https://try.kotlinlang.org/#/Kotlin%20Koans/Properties/Properties/Task.kt - here is all ok.

AlexStankevich avatar Sep 10 '18 16:09 AlexStankevich