kevinmost
08/11/2017, 7:35 PMcompanion 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