Scala giving me “illegal start of definition”

It looks like you’re trying to declare the package membership in a Scala script (run using the scala command) or in the REPL.

Only files defining just classes and objects which are compiled with scalac may be defined as belonging to a package.

When you run code in a script or a REPL session, behind the scenes it is actually compiled inside a method of an object, in which scope a package declaration wouldn’t be legal.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)