Skip to content

Instantly share code, notes, and snippets.

@kirillzh
Last active March 19, 2018 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirillzh/088d0a1bfe38ff2b242a81b9a959944c to your computer and use it in GitHub Desktop.
Save kirillzh/088d0a1bfe38ff2b242a81b9a959944c to your computer and use it in GitHub Desktop.
Kotlin Lint failing when Java accessing class, method or field annotated with "@VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)"
// Located in kotlin/com.example
package com.example
class Bar {
fun bar() {
Foo.doSomething()
// Lint complaining that "This method should only be accessed from tests or within package private scope" even though it's the same package
}
}
// Located in java/com.example
package com.example;
import android.support.annotation.VisibleForTesting;
public class Foo {
@VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
public static void doSomething() {
System.out.println("nope");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment