Please explain why this is the case.
let double = Double(1.1)
let anyObject = double as AnyObject
print(double is AnyObject) // 'is' test is always true
The above code generates a warning which is in the comment on the code. It prints "true."
protocol ClassProtocol: AnyObject {
}
extension Double: ClassProtocol { // Non-class type 'Double' cannot conform to class protocol 'ClassProtocol'
}
However, this code above generates the error in the code comment.