8c52bb4212
Call checker and declaration checker are used in order to preserve backward compatibility. Attempt to use classifier usage checker was not good enouth, since not all errors found with it would actually be reported before. For example types and constructor calls don't cause supertypes to resolve, so missing supertypes would not lead to errors in case they are the only use of class name. Updated tests failing due to missing Java dependencies in superclasses.
38 lines
844 B
Kotlin
Vendored
38 lines
844 B
Kotlin
Vendored
//KT-819 Redeclaration error for extension properties with the same name and different receivers
|
|
// FULL_JDK
|
|
|
|
import java.io.*
|
|
|
|
val InputStream.buffered : BufferedInputStream
|
|
get() = if(this is BufferedInputStream) <!DEBUG_INFO_SMARTCAST!>this<!> else BufferedInputStream(this)
|
|
|
|
val Reader.buffered : BufferedReader
|
|
get() = if(this is BufferedReader) <!DEBUG_INFO_SMARTCAST!>this<!> else BufferedReader(this)
|
|
|
|
|
|
//more tests
|
|
open class A() {
|
|
open fun String.foo() {}
|
|
open fun Int.foo() {}
|
|
|
|
open val String.foo: Int
|
|
get() = 0
|
|
open val Int.foo: Int
|
|
get() = 1
|
|
}
|
|
|
|
class B() : A() {
|
|
override fun String.foo() {}
|
|
override fun Int.foo() {}
|
|
|
|
override val String.foo: Int
|
|
get() = 0
|
|
override val Int.foo: Int
|
|
get() = 0
|
|
|
|
fun use(s: String) {
|
|
s.foo
|
|
s.foo()
|
|
}
|
|
}
|