Thanks a lot @AlexanderM, @cukr and @anon9791410
Just my observation, it doesn't tell why it is happening but looks like all free bridging will satisfy is
clause
struct S {}
let s1 = S()
print(s1 is AnyObject) //compiler: 'is' test is always true
import Foundation
let str : String = ""
print(str is NSString) //compiler: 'is' test is always true
Question:
So is there a way to be sure only class instances can be passed to a function (Example below)?
func f1(anyObject: AnyObject) {} //Is there any way to restrict the parameter to only class instances?
let a : AnyObject = S() as AnyObject //S is a struct
f1(anyObject: a) //valid