KT-3563 Compiler requiring java.io.File, and it's unclear why
#KT-3563 fixed
This commit is contained in:
@@ -19,7 +19,7 @@ class A
|
||||
fun A.plus(<!UNUSED_PARAMETER!>a<!> : Any) {
|
||||
|
||||
1.foo()
|
||||
true.<!NONE_APPLICABLE!>foo<!>()
|
||||
true.<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!>(<!NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
|
||||
<!UNUSED_EXPRESSION!>1<!>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// KT-3563 Compiler requiring java.io.File, and it's unclear why
|
||||
|
||||
package bar
|
||||
|
||||
import java.io.File
|
||||
|
||||
class Customer(name: String)
|
||||
|
||||
fun foo(f: File, c: Customer) {
|
||||
f.name
|
||||
|
||||
c.<!UNRESOLVED_REFERENCE!>name<!> // name should be unresolved here
|
||||
}
|
||||
|
||||
//from standard library
|
||||
val File.name: String
|
||||
get() = getName()
|
||||
@@ -0,0 +1,49 @@
|
||||
package bar
|
||||
|
||||
|
||||
// should be thrown away
|
||||
|
||||
fun <R> List<R>.a() {}
|
||||
|
||||
fun test1(i: Int?) {
|
||||
1.<!UNRESOLVED_REFERENCE!>a<!>()
|
||||
i.<!UNRESOLVED_REFERENCE!>a<!>()
|
||||
}
|
||||
|
||||
fun <R> test2(c: Collection<R>) {
|
||||
c.<!UNRESOLVED_REFERENCE!>a<!>()
|
||||
}
|
||||
|
||||
fun Int.foo() {}
|
||||
|
||||
fun test3(s: String?) {
|
||||
"".<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
s.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
}
|
||||
|
||||
trait A
|
||||
fun <T: A> T.c() {}
|
||||
|
||||
fun test4() {
|
||||
1.<!UNRESOLVED_REFERENCE!>c<!>()
|
||||
}
|
||||
|
||||
|
||||
// should be an error on receiver, shouldn't be thrown away
|
||||
|
||||
fun test5() {
|
||||
<!TYPE_MISMATCH!>1<!>.{ String.(): String -> this}()
|
||||
}
|
||||
|
||||
fun <R: Any> R?.sure() : R = this!!
|
||||
|
||||
fun <T> test6(l: List<T>?) {
|
||||
<!TYPE_MISMATCH!>l<!>.sure<T>()
|
||||
}
|
||||
|
||||
|
||||
fun List<String>.b() {}
|
||||
|
||||
fun test7(l: List<String?>) {
|
||||
<!TYPE_MISMATCH!>l<!>.b()
|
||||
}
|
||||
Reference in New Issue
Block a user