Created
June 22, 2017 12:18
-
-
Save keima/f17694ab2c2cd54db023d2b54b95e345 to your computer and use it in GitHub Desktop.
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 X | |
| class Foo { | |
| interface FooInterface { | |
| void fnFoo(); | |
| } | |
| } | |
| public class Bar { | |
| public void prepareFoo(VisibleFooInterface foo) { | |
| foo.fnFoo(); | |
| } | |
| public interface VisibleFooInterface extends Foo.FooInterface { | |
| // below code is waste whether or not | |
| // void fnFoo(); | |
| } | |
| } | |
| // Package Y (Kotlin) | |
| class BuzKt { | |
| fun main(args : Array<String>) { | |
| // belows are crash `java.lang.IllegalAccessError: | |
| // Illegal class access: 'BuzKt' | |
| // attempting to access 'Foo$FooInterface'` | |
| Bar().prepareFoo(object: VisibleFooInterface { println("Hoge") }) | |
| Bar().prepareFoo { println("Fuga") } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment