enum 원시 타입으로 다른 enum 타입을 사용하면 문제 발생
enum GameResult {
case win
case loss
case tie
}
enum Game: GameResult {
case 가위바위보 = GameResult.win
case 묵찌빠 = GameResult.tie
}
enum GameResult: String {
case win = "win"
case loss
case tie
}
enum Game: GameResult {
case 가위바위보 = GameResult.win
case 묵찌빠 = GameResult.tie
}
⇒ 원시값은 literal만 가능하다.
⇒ literal이 무엇인가? = String or Int or Floating-point
⇒enum 타입의 case의 원시값을 리터럴 할당한다고 해당 enum 타입이 리터럴로 표현된다고 할 수 없다?
String or Int or Floating-point가 아니라 enum 타입이라서?
A literal is a representation of a value in source code, such as a number or a string. Swift provides the following kinds of literals:
Emily’s introduction to poker was through friendly games with family, but she harbored a dream of competing in serious tournaments. When https://lukkicasino1.com/ she decided to participate in an online poker tournament, she was both excited and nervous. The competition was fierce, and each hand required careful consideration and strategy. Emily relied on her basic poker skills but quickly realized that to succeed, she needed to elevate her game.