Markus K
Markus K

Reputation: 1653

@VisibleForTesting in Kotlin?

I have added @VisibleForTesting on a public property in a Kotlin class and then used in where it shouldn't be allowed, yet my lint checks pass successfully. Should I avoid @VisibleForTesting in Kotlin? This is an Android project.

Upvotes: 3

Views: 5609

Answers (1)

gmetal
gmetal

Reputation: 2988

It appears to be a bug. I've opened up a bug report describing the issue. As far as I can tell, this only affects property access. A workaround in your case would be to use a regular function call.

Upvotes: 2

Related Questions