Files
kotlin-fork/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.kt
T
Stanislav Erokhin 298a075381 Minor. removed functions which declared in Standard.kt from diagnostic testdata.
Removed declaration for functions: TODO, run, with, apply, let.
2016-01-25 19:13:31 +03:00

22 lines
372 B
Kotlin
Vendored

// !DIAGNOSTICS: -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER
package p
private fun foo(a: Int) = run {
object {
inner class A
fun foo() = A()
}.foo()
}
private fun foo() = run {
object {
inner class A
fun foo() = A()
}.foo()
}
fun test() {
var x = foo(1)
x = <!TYPE_MISMATCH!>foo()<!>
}