Last active
March 19, 2018 23:50
-
-
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)"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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