Use concrete candidate to resolve collection literal

This helps to avoid resolution errors when there is local array-like function with the same signature as in built-ins
This commit is contained in:
Mikhail Zarechenskiy
2017-03-22 17:52:51 +03:00
parent 222f101d10
commit 2a93dea0c4
6 changed files with 78 additions and 10 deletions
@@ -0,0 +1,18 @@
// !LANGUAGE: +ArrayLiteralsInAnnotations
// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNSUPPORTED
annotation class Anno(val a: Array<String> = [""], val b: IntArray = [])
@Anno([], [])
fun test() {}
fun arrayOf(): Array<Int> = TODO()
fun intArrayOf(): Array<Int> = TODO()
fun local() {
val a1: IntArray = [1, 2]
val a2: IntArray = []
val s1: Array<String> = [""]
val s2: Array<String> = []
}