E119: Symbol Is Not a Value

This error is emitted when a package or Java-defined class is used in a position where a value is expected.

Packages and Java classes (without companion objects) cannot be used as values in Scala.


Example

val x = java.util

Error

-- [E119] Type Error: example.scala:1:13 ---------------------------------------
1 |val x = java.util
  |        ^^^^^^^^^
  |        package java.util is not a value

Solution

// Use a specific value from the package
val x = scala.collection.immutable.List
// Or import and use a specific type
import scala.collection.mutable.ArrayBuffer
val x = ArrayBuffer[Int]()