Is this code legal?
The code compiles successfully on xcode 15, but the compiler crashes on xcode 16
let row:Any = TestRow()
if let row = row as? (any EntityRow) {
print(row.entity.guid)
}
class TestEntity:Entity{
var guid: UUID = UUID()
}
class Row{
var height:CGFloat = 0;
}
protocol Entity{
var guid:UUID{get}
}
protocol EntityRow:AnyObject {
associatedtype E:Entity;
var entity:E {get set}
}
class TestRow:Row,EntityRow{
var entity:TestEntity = .init()
}