Should my `commonTest` module be able to see `inte...
# announcements
k
Should my
commonTest
module be able to see
internal
code from
commonMain
? Are they part of the same compile group?
r
k
Hmm
This is the error I'm getting
Copy code
e: /home/kevin/code/okio/okio/src/commonTest/kotlin/okio/OkioMessageDigestTest.kt: (29, 18): Unresolved reference: Sha1MessageDigest
r
If the error is only in IntelliJ, then this is probably the same issue.
k
I'm getting it building with gralde on the command line too
r
internal
in main should be visible in test module.
k
Yeah, something is up. I'm going to have to fiddle with it I think
The issue mentions a sample project, yet I am unable to see one attached. Are you able to see it?
r
No
a
I've made the sample projects visible
k
Thank you!
One more thought: I've checked project structure, dependency on commonMain is present.
This is mentioned in the support thread. I checked the project out and I'm not seeing any explicit dependency on commonMain from commonTest. this is what's in the project.
Copy code
commonMain {
            dependencies {
                implementation kotlin('stdlib-common')
            }
        }
        commonTest {
            dependencies {
                implementation kotlin('test-common')
                implementation kotlin('test-annotations-common')
            }
        }
I've got to be missing something. I'm running with 1.3.72 atm with this build gradle file. https://github.com/square/okio/blob/master/okio/build.gradle Any thoughts? @Alexey Belkov [JB]
I understand that's it's currently a bug/limitation of the IDE for internal code to not be seen between test and main. However, I'm getting errors when tryring to compile on the commandline, as well
a
commonTest doesn't declare an explicit dependency on commonMain, that's OK. Do you mean you can't compile current master branch of https://github.com/square/okio?
k
Master compiles fine. I've got a fork where I'm trying to test some internal code, and anything marked with internal is giving a compiler error
a
I can only find https://youtrack.jetbrains.com/issue/KT-33712. Or it's a new issue. Can you please report to http://kotl.in/issue with steps to reproduce?
k
Sure I can report it
No need actually 🙂 updating to 1.4 solved the issue
🎉 1