IDE: Fire Version: Version 10.0.0.2400 (develop) built on talax, 20190503-102703. Commit dc2f219. Target (If relevant): iOS Description:
I am trying to store the current selected Client using a static var on the model class like Client.current = client but when I am compiling I am getting an error: Variable expected on that line. I am not sure why?
Total code:
let client = Client(id: "1", name: "Client")
Client.current = client
Expected Behavior:
Able to compile the project without compiler errors
Actual Behavior:
I am getting a compiler error when trying to compile the code
Steps:
Please a find reproducible project attached
It’s defined as listed below as you can see the current-property is a var already. I don’t think that my client-variable which has an instance of Client-struct is a let should be an issue here.
final public struct Client {
let id: String
let name: String
init(id: String, name: String) {
self.id = id
self.name = name
}
}
extension Client {
static var current: Client!
}