Resolve local function parameters with function inner scope

This allows to use type parameters and value paramters in default value expressions

 #KT-7984 Fixed
 #KT-7985 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-04-14 16:10:52 +03:00
parent e86d52b681
commit b17b3f4c63
17 changed files with 121 additions and 4 deletions
@@ -0,0 +1,11 @@
fun foo(): String {
fun bar(x: String, y: String = x): String {
return y
}
return bar("OK")
}
fun box(): String {
return foo()
}
@@ -0,0 +1,6 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo() {
fun bar(x: String, y: String = x) {}
fun baz(x: Int = <!UNINITIALIZED_PARAMETER!>y<!>, y: Int) {}
}
@@ -0,0 +1,3 @@
package
public fun foo(): kotlin.Unit
@@ -0,0 +1,7 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo() {
fun <T> bar(x: List<T> = listOf<T>()) {}
}
fun <T> listOf(): List<T> = TODO()
@@ -0,0 +1,4 @@
package
public fun foo(): kotlin.Unit
public fun </*0*/ T> listOf(): kotlin.collections.List<T>