I would like to check constructor arguments and refuse to construct throwing IllegalArgumentException in case the arguments set is not valid (the values don\'t
IllegalArgumentException
scala> class Foo(arg: Int) { | require (arg == 0) | } defined class Foo scala> new Foo(0) res24: Foo = Foo@61ecb73c scala> new Foo(1) java.lang.IllegalArgumentException: requirement failed