mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 00:21:29 +00:00
Currently all tests in boxWithStdlib/ run with both runtime and reflection included; eventually they'll be merged into box/ using these directives
20 lines
384 B
Kotlin
Vendored
20 lines
384 B
Kotlin
Vendored
// WITH_RUNTIME
|
|
// FILE: Test.java
|
|
|
|
public class Test {
|
|
public static String invokeMethodWithOverloads() {
|
|
C<String> c = new C<String>();
|
|
return c.foo("O");
|
|
}
|
|
}
|
|
|
|
// FILE: generics.kt
|
|
|
|
class C<T> {
|
|
@kotlin.jvm.JvmOverloads public fun foo(o: T, k: String = "K"): String = o.toString() + k
|
|
}
|
|
|
|
fun box(): String {
|
|
return Test.invokeMethodWithOverloads()
|
|
}
|