 <p>The actual problem was I was not binding them both with another object. (REPL) Additional Info: Because the companion object and the class must be defined in the same source file you cannot create them in the interpreter. source: daily-scala work around: bind both with some object in REPL or as user #shadowlands said You can create them in the REPL, but you need to do so as part of a single :paste command (type :help for a list of REPL commands)</p>