Not sure if this is the best place for this but I’...
# announcements
a
Not sure if this is the best place for this but I’m having trouble accessing an
internal
class from a unit test in the same module. Android Studio shows no issues but when I try to compile I just get
Cannot access 'XXX': it is internal in 'YYY'
. This is using Kotlin 1.2.20
Here is a minimal example that fails to compile:
Copy code
internal object Foo {
    const val foo = "foo"
}
Copy code
class TestFoo {
    @Test
    fun testFoo() {
        assertEquals("foo", Foo.foo)
    }
}
It fails with this error:
Copy code
TestFoo.kt: (10, 29): Cannot access 'Foo': it is internal in 'com.example'