Avatar
treastrain / Tanaka.R 9/20/2024 9:02 AM
@swift-5.10.1 @swift-6.0.3 import Foundation protocol HogeProtocol: Equatable { static var aaa: Self { get } static var bbb: Self { get } } extension HogeProtocol { static func == (lhs: Self, rhs: Self) -> Bool { return lhs == rhs } } enum Hoge: HogeProtocol { case aaa case bbb } let hoge: (some HogeProtocol) = Hoge.aaa switch hoge { case .aaa: print("aaa") case .bbb: print("bbb") default: print("default") }