The reason for the error is that, when the compiler sees val model = PersonModel, it assumes you're trying to assign the companion object of the PersonModel class to model, but there isn't one, so it gives you the most helpful message it can, not realizing you made a simple syntax mistake.
You need to use
:
, not=
.The reason for the error is that, when the compiler sees
val model = PersonModel
, it assumes you're trying to assign the companion object of thePersonModel
class tomodel
, but there isn't one, so it gives you the most helpful message it can, not realizing you made a simple syntax mistake.