Avatar
@swift-5.3.3 class Animal {} class Cat: Animal {} class Dog: Animal {} func foo() -> some Animal { Bool.random() ? Cat() : Dog() } print(foo())