KT-819 Redeclaration error for extension properties with the same name and different receivers

This commit is contained in:
svtk
2011-12-26 18:37:21 +04:00
parent 0dc31ae71f
commit 36f50fa594
27 changed files with 284 additions and 95 deletions
@@ -0,0 +1,34 @@
//+JDK
//KT-819 Redeclaration error for extension properties with the same name and different receivers
import java.io.*
inline val InputStream.buffered : BufferedInputStream
get() = if(this is BufferedInputStream) this else BufferedInputStream(this)
inline val Reader.buffered : BufferedReader
get() = if(this is BufferedReader) this else BufferedReader(this)
//more tests
open class A() {
open fun String.foo() {}
open fun Int.foo() {}
open val String.foo = 0
open val Int.foo = 1
}
class B() : A() {
override fun String.foo() {}
override fun Int.foo() {}
override val String.foo = 0
override val Int.foo = 0
fun use(s: String) {
s.foo
s.foo()
}
}