-
-
Save Stebalien/8589423 to your computer and use it in GitHub Desktop.
This file contains 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
class Bar { | |
fun invoke(x: Int): Int = x | |
} | |
class Foo { | |
val get: Bar = Bar() | |
} | |
class Baz { | |
public fun get(x: Int) : Int = x | |
} | |
// Compiles | |
fun test1 () { | |
Foo().get(1) | |
} | |
// Compiles | |
fun test2() { | |
Baz()[1] | |
} | |
// Does not compile | |
fun test3() { | |
Foo()[1] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment