diff --git a/src/main/kotlin/lotto/domain/LottoNumber.kt b/src/main/kotlin/lotto/domain/LottoNumber.kt index b1eaf1ac4..5f6a5116b 100644 --- a/src/main/kotlin/lotto/domain/LottoNumber.kt +++ b/src/main/kotlin/lotto/domain/LottoNumber.kt @@ -3,11 +3,12 @@ package lotto.domain @JvmInline value class LottoNumber(val number: Int) { init { - require(number in START_LOTTO_NUMBER..END_LOTTO_NUMBER) + require(number in lottoNumberRange) } companion object { const val START_LOTTO_NUMBER = 1 const val END_LOTTO_NUMBER = 45 + val lottoNumberRange = START_LOTTO_NUMBER..END_LOTTO_NUMBER } }