/* 型キャスト asを使って型の判定 */ // var things = Any[]() // error: value of type 'Any.Protocol' has no subscripts var things : [Any] = [] things.append(0) things.append(0.0) for thing in things { switch thing { case 0 as Int: print("zero as an Int") case 0 as Double: print("zero as a Double") default: // TOFIX : error: switch must be exhaustive break // TOFIX: error: 'default' label in a 'switch' should have at least one executable statement } }