I have the following class in Android project in Fire:
class ValueChangeParams<T> {
init(from anOldValue: T, to aNewValue: T) {
self.newValue = aNewValue
self.oldValue = anOldValue
}
public var newValue: T
public var oldValue: T
}
If I use it like this:
protocol SomeControl {
func doSomething(_ aParams: Any)
}
extension SomeControl {
func valueWillChange(from anOldValue: Any?, to aNewValue: Any?) {
let params = ValueChangeParams<Any?>(from: anOldValue, to: aNewValue)
doSomething(params)
}
}
I get the following compilation errors:
Value passed for parameter 1 is nullable but must be not null in call to init(from aNewValue: Any?, to anOldValue: Any?) [CommonLib.Controls.Protocols.swift (62)]
Value passed for parameter 2 is nullable but must be not null in call to init(from aNewValue: Any?, to anOldValue: Any?) [CommonLib.Controls.Protocols.swift (62)]
It compiles fine in Xcode 10.