Add a constraint for nested call

if there are no bounds on variables in this call return type
This commit is contained in:
Svetlana Isakova
2015-06-27 17:19:20 +03:00
parent 1463ff7258
commit 179c5e3c3a
5 changed files with 60 additions and 11 deletions
@@ -4,7 +4,7 @@
package n
fun main(args: Array<String>) {
val <!UNUSED_VARIABLE!>a<!> = array(<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>array<!>())
val <!UNUSED_VARIABLE!>a<!> = <!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>array<!>(<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>array<!>())
val <!UNUSED_VARIABLE!>a0<!> : Array<Array<Int>> = array(array())
val a1 = array(array<Int>())
checkSubtype<Array<Array<Int>>>(a1)
@@ -8,5 +8,5 @@ fun <T, C: Collection<T>> convert(src: Collection<T>, dest: C): C = throw Except
fun test(l: List<Int>) {
//todo should be inferred
val r = convert(l, HashSet())
checkSubtype<Collection<Int>>(r)
r checkType { _<HashSet<Int>>() }
}
@@ -21,5 +21,5 @@ fun <T, C: Base<T>> convert(src: HS<T>, dest: C): C = throw Exception("$src $des
fun test(l: HS<Int>) {
//todo should be inferred
val r = convert(l, HS())
checkSubtype<Base<Int>>(r)
r checkType { _<HS<Int>>() }
}