because in the constructor parameter instance of `...
# getting-started
e
because in the constructor parameter instance of
MyClass
is not yet defined. You should move
fun1
to companion object and call it accordingly, or make it top-level function, unless it, of course, has to be attached to instance, in which case you'll have to find another way of creating default parameters.