Made bridge methods public.
Added test on usage of a bridge method from different module. Bridge methods must be public in order use them from other modules.
This commit is contained in:
+1
-1
@@ -93,7 +93,7 @@ internal class SpecialDescriptorsFactory(val context: Context) {
|
|||||||
},
|
},
|
||||||
returnType,
|
returnType,
|
||||||
descriptor.modality,
|
descriptor.modality,
|
||||||
Visibilities.PRIVATE)
|
Visibilities.PUBLIC)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -573,6 +573,12 @@ task bridges_test16(type: RunKonanTest) {
|
|||||||
source = "codegen/bridges/test16.kt"
|
source = "codegen/bridges/test16.kt"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task bridges_linkTest(type: LinkKonanTest) {
|
||||||
|
goldValue = "42\n42\n42\n"
|
||||||
|
source = "codegen/bridges/linkTest_main.kt"
|
||||||
|
lib = "codegen/bridges/linkTest_lib.kt"
|
||||||
|
}
|
||||||
|
|
||||||
task classDelegation_method(type: RunKonanTest) {
|
task classDelegation_method(type: RunKonanTest) {
|
||||||
goldValue = "OKOK\n"
|
goldValue = "OKOK\n"
|
||||||
source = "codegen/classDelegation/method.kt"
|
source = "codegen/classDelegation/method.kt"
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package a
|
||||||
|
|
||||||
|
interface A<T> {
|
||||||
|
fun foo(): T
|
||||||
|
}
|
||||||
|
|
||||||
|
open class C: A<Int> {
|
||||||
|
override fun foo(): Int = 42
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import a.*
|
||||||
|
|
||||||
|
class B: C()
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
val b = B()
|
||||||
|
println(b.foo())
|
||||||
|
val c: C = b
|
||||||
|
println(c.foo())
|
||||||
|
val a: A<Int> = b
|
||||||
|
println(a.foo())
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user