I met this strange error too, I google it and people said it is Swift's bug, hasn't been fixed.
I debug line by line, find out the solution.
The reason this error appears
In EditRecordVC
I have generic type function func update<RO>(operation: RO) where RO : RealmOperation, RO.R == EditRecordVC.R
In its subclass ConflictedRecordEditVC
, I override the function, I input update
, and Xcode helps me finishing the whole function override func update<RO>(record: Record?, operation: RO?) where RO : RealmOperation, RO.R == Record
, compile well.
Run the code, after the overridden function is executed, this error will appear, the Xcode will stop at some random line, nobody can find out it is caused by this function.
I debug line by line, find out I have to change the generic type to override func update<RO>(operation: RO) where RO : RealmOperation, RO.R == Record
, everything will work well again.
I forget when I added the ? by mistake and Xcode isn't angry.
So check you generic type function and make sure it is exactly same with super class