Initial internal member mangling

This commit is contained in:
Michael Bogdanov
2015-10-05 11:54:06 +03:00
parent 306ac73eb7
commit 882f6113dc
28 changed files with 364 additions and 30 deletions
@@ -0,0 +1,14 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlinc] Compiling [[TestData]/module1.kt] => [[Temp]/module1.jar]
[kotlinc] Compiling [[TestData]/module2.kt] => [[Temp]/module2.jar]
[java] A_OA_K
[java] B_OB_K
[java] C_OC_K
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -0,0 +1,21 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlinc src="${test.data}/module1.kt" output="${temp}/module1.jar" modulename="module1"/>
<kotlinc src="${test.data}/module2.kt" output="${temp}/module2.jar" modulename="module2">
<classpath>
<pathelement path="${temp}/module1.jar"/>
</classpath>
</kotlinc>
<java classname="hello.Module2Kt" fork="true">
<classpath>
<pathelement path="${temp}/module1.jar"/>
<pathelement path="${temp}/module2.jar"/>
<pathelement location="${kotlin.runtime.jar}"/>
</classpath>
</java>
</target>
</project>
@@ -0,0 +1,11 @@
package hello
open class A {
internal val z: String = "A_O"
internal fun test() = "A_K"
}
public fun invokeOnA(a: A) = a.z + a.test()
@@ -0,0 +1,29 @@
package hello
open class B : A() {
internal val z: String = "B_O"
internal fun test() = "B_K"
}
class C : A() {
public val z: String = "C_O"
public fun test() = "C_K"
}
public fun invokeOnB(b: B) = b.z + b.test()
public fun invokeOnC(c: C) = c.z + c.test()
fun main(args: Array<String>) {
val b = B()
println(invokeOnA(b))
println(invokeOnB(b))
println(invokeOnC(C()))
}