bcc8802014
Expression will be checked against expected type later. Theoretically, this is not very good, but it aligns with the old inference, plus it helps avoiding multiple type mismatch diagnostics.
17 lines
418 B
Kotlin
Vendored
17 lines
418 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
fun foo(<!UNUSED_PARAMETER!>u<!> : Unit) : Int = 1
|
|
|
|
fun test() : Int {
|
|
foo(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>)
|
|
val <!UNUSED_VARIABLE!>a<!> : () -> Unit = {
|
|
foo(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>)
|
|
}
|
|
return 1 <!NONE_APPLICABLE!>-<!> "1"
|
|
}
|
|
|
|
class A() {
|
|
val x : Int = <!TYPE_MISMATCH!>foo1(<!TOO_MANY_ARGUMENTS, UNRESOLVED_REFERENCE!>xx<!>)<!>
|
|
}
|
|
|
|
fun foo1() {}
|