@JvmField no longer inferred in RC EAPs?


#1

After switching to 1.0.0-rc-1017, we now have to add explicit @JvmField in more places than before, e.g.:

class MyJunitTest {
  companion object {
    @ClassRule
    @JvmField
    val tempFolder = TemporaryFolder() 
  }

Is this change intentional? This is becoming quite verbose.


#2

It’s been announced and reasoned in Beta Candidate, please see @JvmField and objects section.


#3

Thanks for the pointer. Sounds like this stopped working a while ago, and I just didn’t notice until now.

It would be handy to have a way to define annotation aliases. This would allow to define a @KotlinRule annotation that would get translated into @Rule and @JvmField at compile time.

In Groovy this feature is called “annotation collectors”:
http://docs.groovy-lang.org/latest/html/api/groovy/transform/AnnotationCollector.html