@CompileStatic으로 아래 코드를 컴파일 할 수 있습니까? import groovy.transform.CompileStatic
@CompileStatic
class CompileStaticTest {
List<Number> numbers = []
void addWithCase(something) {
switch
"What's new in Groovy 2.0"을 읽었으므로 @CompileStatic을 언제 사용하는지 혼란 스럽습니다. 이 기사에서는 Java7의 동적 호출 부분을 활용할 수없는 개발자를 위해 @CompileStatic 주석이 추가되었다고 언급했습니다. 성능 향상을 원하는 개발자는 JDK 7에서 실행할 수없는 경우 Groovy 2.0에서 많은 변경 사항
저는 초보 프로그래머입니다. 정적 컴파일 (@CompileStatic annotation)을 사용하여 switch-case-break 명령문의 이상한 동작에 직면했습니다. break은 무시됩니다. 문서를 읽는 동안 버그가 있거나 뭔가를 놓쳤습니다. 환경 : - groovy sdk 2.1.0
- Oracle JDK build 1.7.0_13-b20
, 그것은 인쇄 예상대로 고정 될 숫자 0에 빈 문자열 : @CompileStatic
public static void main(String[] args) {
def inList = ["a", "b", "c"]
def outList = inList.inject(0, { a, b -> a + "," + b })
println(ou