Hi there,
Say that I have 2 files:
- src/main/kotlin/sample/Hello.kt
package sample
internal fun callMe() = "hello"
- src/test/kotlin/sample/HelloTest.kt
package sample
fun testCallMe() = callMe()
When I try to compile this I get the following error (gradle and idea):
e: C:\Development\Projects\kotlin-js-example\src\test\kotlin\sample\HelloTest.kt: (10, 20): Cannot access 'callMe': it is internal in 'sample'
I expected this to work, because both functions are defined in the same package. The reference resolves in the IDEA editor. Is it possible to make this call compile?
Here’s my gradle config:
apply plugin: 'kotlin2js'
sourceSets {
main.kotlin.srcDirs += "src/main/kotlin"
test.kotlin.srcDirs += "src/test/kotlin"
}
compileKotlin2Js {
kotlinOptions.moduleKind = "amd"
kotlinOptions.sourceMap = true
}
compileTestKotlin2Js {
kotlinOptions.moduleKind = "amd"
kotlinOptions.sourceMap = true
}