Skip to content

Instantly share code, notes, and snippets.

@damien5314
Created July 16, 2017 00:00
Testing Kotlin's @JvmSynthetic annotation
package foo
class Apple
fun Apple.slice() { }
@JvmSynthetic
fun Apple.peel() { }
package foo;
public class JavaKnife {
void test() {
Apple apple = new Apple();
foo.AppleKt.slice(apple);
foo.AppleKt.peel(apple); // Cannot resolve method 'peel(foo.Apple)'
}
}
package foo
class KotlinKnife {
fun test() {
val apple = Apple()
apple.slice()
apple.peel()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment