다음 스칼라 코드가 있습니다. IntelliJ는 "기호 n을 해결할 수 없습니다"라고 말합니다. "File | Invalidate"트릭을 시도했지만 문제가 해결되지 않았습니다.IntelliJ 기호를 해결할 수 없습니다. n
abstract class Nat {
def isZero: Boolean
def predecessor: Nat
def successor: Nat = new Succ(this)
def +(that: Nat): Nat
def -(that: Nat): Nat
}
object Succ (n: Nat) extends Nat {
def isZero: Boolean = false
def predecessor: Nat = n
def +(that: Nat) = new Succ(n + that)
def -(that: Nat): Nat = if (that.isZero) this else n - that.predecessor
}
아. 나는 그것을 명심 할 것이다. – johnsam
@ johnsam 행운을 빕니다.) –