Hello! I have a question about the language, pleas...
# getting-started
a
Hello! I have a question about the language, please if Im in the wrong channel tell me. I have two variables in a class, one is a
lateinit var myVariable1
that will be injected later and another one is a val that is initialised by a extension function that returns a
lazy
with the function that initialises my
variable2
(this extension needs my previous
lateinit var myVariable1
by parameter) . When Im creating my class, Im receiving an error because the ´lateinit var myVariable1´ is null at the moment that the class is created(and lateinit cannot be null). Shouldnt this be protected? As Im using only that` lateinit var myVariable1` parameter in my lazy function, that will be triggered always after my ´lateinit var´ is injected?
h
I'm not sure I understand what you're trying to do. Can you post a code sample?
a
yeah sorry