I have an application that uses the App trait and everything works fine. But the object that inherits from the App becomes a little cumbersome, so I would like to separate some of the functionality into features. In particular, I would like to separate the processing of command line arguments.
Unfortunately, this does not look good with DelayedInit . So this works great:
object Main extends App { println("arguments are: "+ args.mkString.mkString(", ")) }
but this raises a NullPointerException :
trait CommandLineArguments { this: App => println("arguments are: "+ args.mkString.mkString(", ")) } object Main extends App with CommandLineArguments
Is there a way to get DelayedInit to "enable" mixed symptoms?
source share