Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Lesson 4 Task 2 error (lazy/get) #139

Open
dmenne opened this issue Mar 16, 2018 · 0 comments
Open

Lesson 4 Task 2 error (lazy/get) #139

dmenne opened this issue Mar 16, 2018 · 0 comments

Comments

@dmenne
Copy link

dmenne commented Mar 16, 2018

When I run the "correct" lazy property example on Android Studio, I get an error for get: unresolved reference, none of the following candidates..."

Works ok online.

class LazyProperty(val initializer: () -> Int) {
    var value: Int? = null
    val lazy: Int
        get() {
            if (value == null) {
                value = initializer()
            }
            return value!!
        }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant