2010-01-11 5 views
1

다음 그루비 코드 :그루비 한 줄 컴파일 실패

No signature of method: java.lang.Integer.upTo() is applicable for argument types: (java.lang.Integer, ConsoleScript4$_run_closure1) values: [5, [email protected]]

메서드 호출이 this method의 서명과 일치하는 것으로 보인다 때문에 문제가 무엇 :

1.upTo(5) {println it} 

이 컴파일 오류를 생성?

감사 돈

답변

3
1.upTo(5) {println it} 

1.upto(5) {println it} 

+0

와우, 그건 당황 스럽네. –

1
(경우 그 오류 ...은 "t"는 "개까지"의 소문자이어야 함)이어야

문제는 최대 통화의 경우입니다.

groovy -e " 1.upto(5) { println it } "