Prohibit callable references to object members
To be able to make them more useful in the future, i.e. bound to the object instance
This commit is contained in:
Vendored
-15
@@ -1,15 +0,0 @@
|
||||
package foo
|
||||
|
||||
open class A {
|
||||
open fun foo(a:String,b:String): String = "fooA:" + a + b
|
||||
}
|
||||
|
||||
object B : A() {
|
||||
override fun foo(a:String,b:String): String = "fooB:" + a + b
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var ref = B::foo
|
||||
val result = ref(B, "1", "2")
|
||||
return (if (result == "fooB:12") "OK" else result)
|
||||
}
|
||||
Reference in New Issue
Block a user