I think there is something else going on here that makes your goal impossible, at least via this route. I note that, in a playground, adding this line to your initial code:
if y is [Any] { print ("OK") }
produces this error message:
error: 'Any' (aka 'protocol<>') is not a subtype of 'Int'
Based on a discussion in another thread, I believe the problem is that an array of elements conforming to a protocol has a different internal structure to an array of structs or class references. [SomeProtocol] is actually [InternalStructDescribingProtocol], where the elements are an internal struct that describes what the actual type of the value is, plus the value itself, or a pointer to an instance.
For this reason, you can't get from [SomeProtocol] to [SomeStruct] with the 'as' operator, since the operator signals a reinterpretation of type, not conversion of value. Putting this another way, different arrays may have different element sizes, even when the elements conform to the same protocol. What you're really want, as you hinted in the title of the thread, is [T] where T is a generic type, and that construct doesn't exist in Swift in contexts like this.
(The waters are muddied here because Swift can also do bridging between Array<> and NSArray, where it conceptually converts the underlying data rather than just casting the type. But apart from bridging special cases, casting — the 'as' operator — does not do conversion.)
What I would suggest:
1. Since you're really trying to bypass Swift's type checking by using (informally-described) "generic" arrays, use class NSArray explicitly. That is, implement your logic as if you're in the Obj-C conceptual world.
2. Use an enum whose cases have associated values to represent the value stored in 'x'. You could have 3 cases: None, Single, Array. However, unless your arrays are actually [Any] at their point of definition, you'll still run into a problem trying to assign between [Any] and [Int] — it's still not generic in the way you want.
Disclaimer: I'm not an expert on this, so I may be mis-describing what Swift expects. What I've said represents my best understanding, so far.