Type does not conform to protocol 'PersistentModel'

I have the following and it's working. However, if I add a new String property, it suddenly returns the error above.

This new property is added as a variable, initialized and conformed to hashable accordingly.

@Model
final class Car {
  var name: String
  var price: Double
  var remarks: String?
  var releaseDate: Date
  var brand: CarBrand
  
  init(name: String, price: Double, remarks: String?, releaseDate: Date, brand: CarBrand) {
  self.name = name
  self.price = price
  self.remarks = remarks
  self.releaseDate = releaseDate
  self.brand = brand
  }
}

extension Car: Identifiable {}

extension Car: Hashable {
  static func == (lhs: Car, rhs: Car) -> Bool {
    lhs.name == rhs.name &&
    lhs.price == rhs.price &&
    lhs.remarks == rhs.remarks &&
    lhs.releaseDate == rhs.releaseDate &&
    lhs.brand == rhs.brand
  }
  
  func hash(into hasher: inout Hasher) {
    hasher.combine(name)
    hasher.combine(price)
    hasher.combine(remarks)
    hasher.combine(releaseDate)
    hasher.combine(brand)
  }
}

enum CarBrand: String, Codable, CaseIterable, Identifiable {
  case brandA
  case brandB
  case brandC

  var id: Self { self }

It's a bug.

I just saw this: https://mastodon.social/@denisdepalatis/110561280521551715

Replacing #Preview with the good old struct ContentView_Previews: PreviewProvider works for me. If y'all can't wait for the fix, this workaround should work.

Thanks to the previous comment!

Type does not conform to protocol 'PersistentModel'
 
 
Q