Perhaps, but with a twist:
class C private constructor(lazy: Lazy<A>) { val expensiveProperty by lazy constructor(value: B) : this(lazy { calculateExpensiveProperty(value) }) constructor(expensiveProperty: A) : this(lazyOf(expensiveProperty)) }
Notice that I kept the main constructor closed, leaving public secondary constructors open.
source share