I personally really hate the `companion object { o...
# getting-started
k
I personally really hate the
companion object { operator fun invoke...
trick. It's so non-obvious what's going on. I'd just do exactly what you'd do in Java when you need validation before your constructor call; make the constructor private and make a factory method that does the validation and, if it passes, constructs an instance for you