I have one entity class like that:

```
case class Entity(id: Integer, name: String)

```

And class command code:

```
trait GeneralCommand {
      val id: Option[Integer]
}

sealed abstract class EntityCommands(id: Option[Integer]) extends DomainCommand {
  def this(id: Integer) = this(Option(id))
}

case class UpdateEntity(entity: Entity, id: Integer = entity.id) extends EntityCommands(id)

```

In Intellij Idea this code is not highlighted. But `sbt clean compile` complains that:

```
not found: value entity
case class UpdateEntity(entity: Entity, id: Integer = entity.id) extends EntityCommands(id)
                                                      ^

```

Is it possible to reuse parameter in case class in scala?