16
최소화 된 예는 다음과 같다 :메소드 내부에서 메소드를 오버로드 할 수없는 이유는 무엇입니까 (예 : 오버로드 된 클로저)?
object Main extends App {
def f = {
def giveMeBigDecimal(x: String) = BigDecimal(x)
def giveMeBigDecimal(x: Double) = BigDecimal(x)
(giveMeBigDecimal("1.0"), giveMeBigDecimal(1.0))
}
}
스칼라 method giveMeBigDecimal is defined twice
내가 아는 나에게 말을 계속 컴파일러 2.9.2 내가 어떻게 workaround this하지만 호기심이 왜 그런 제한이 존재한다.
가능한 복제본 - http://stackoverflow.com/questions/7550302/why-method-overloading-does-not-work-inside-another-method – Rogach
@Rogach 대부분 질문 및 답변 * 해결 방법 * 왜 이렇게이다* –