Will groovy (grails) give you compile time checking like java?

后端 未结 5 1674
感动是毒
感动是毒 2021-02-20 18:20

Will groovy (grails) give you compile time checking like java?

If you always specify the type, will that change things much?

5条回答
  •  自闭症患者
    2021-02-20 18:51

    Since Groovy 2.0 it is possible to check types at compile time. Annotations can be used on class or method: @TypeChecked or @CompileStatic. The 1st one tells compiler to do type checking during compilation and the 2nd one force it to do 'static compilation' which more or less results with binary code like from native JAVA compiler. Of course, usage of the 2nd annotation involves type checking by itself.

    Grails 2.2 is the first release that uses Groovy 2.0.

提交回复
热议问题