Created
July 16, 2017 00:00
-
-
Save damien5314/5d7d719a6a4e722299f9f9fa568a5192 to your computer and use it in GitHub Desktop.
Testing Kotlin's @JvmSynthetic annotation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package foo | |
| class Apple | |
| fun Apple.slice() { } | |
| @JvmSynthetic | |
| fun Apple.peel() { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)' | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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