I went to sleep after that last post, and woke up thinking, "Wait, would that form possibly work for your actual use case?".
let array = [1,2,3]
let anyArray: [some Any] = array
let arrayActual = anyArray as! [Int] // πΆπ
struct Woo<Boo> { let boo: Boo }
let woo = Woo(boo: 3)
let anyWoo: Woo<some Any> = woo
let wooActual = anyWoo as! Woo<Int> // πΆπ
var xs2: [some Any] = [1, 2, 3]
xs2 as! [Int] // πΆπ
xs2.append("yello") // No exact matches in call to instance method 'append'
You still can't do as some
though; you need the extra line.