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.
23 lines
361 B
Kotlin
Vendored
23 lines
361 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
// !DIAGNOSTICS: -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER
|
|
|
|
package p
|
|
|
|
private fun foo(a: Int) = run {
|
|
class A {
|
|
inner class B
|
|
}
|
|
A().B()
|
|
}
|
|
|
|
private fun foo() = run {
|
|
class A {
|
|
inner class B
|
|
}
|
|
A().B()
|
|
}
|
|
|
|
fun test() {
|
|
var x = foo(1)
|
|
x = <!TYPE_MISMATCH!>foo()<!>
|
|
} |