Avatar
Avatar
ジュニア
@swift-5.10.1 @_typeEraser(AnyP) protocol P {} struct ConcreteP1: P {} struct AnyP: P { init(erasing base: some P) { print("Erasing:", base) } } struct Foo { dynamic var p: some P { ConcreteP1() } } print(Foo().p) (edited)
swift510 BOT 4/7/2024 3:31 AM
Erasing: ConcreteP1() AnyP() (edited)