E015: Repeated Modifier

This error is emitted when the same modifier is specified more than once on a definition. Each modifier should only appear once.


Example

private private val x = 1

Error

-- [E015] Syntax Error: example.scala:1:8 --------------------------------------
1 |private private val x = 1
  |        ^^^^^^^
  |        Repeated modifier private
  |-----------------------------------------------------------------------------
  | Explanation (enabled by `-explain`)
  |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  | This happens when you accidentally specify the same modifier twice.
  |
  | Example:
  |
  | private private val Origin = Point(0, 0)
  |
  | instead of
  |
  | private final val Origin = Point(0, 0)
   -----------------------------------------------------------------------------

Solution

// Remove the duplicate modifier
private val x = 1
// If you meant to use different modifiers, use the correct combination
private final val x = 1