supertype of error type should be an error type, not any

This commit is contained in:
Svetlana Isakova
2013-01-10 11:00:53 +04:00
parent 142d9a090c
commit 33a82da493
3 changed files with 32 additions and 0 deletions
@@ -0,0 +1,24 @@
package a
import java.util.Date
import java.util.Comparator
fun foo() {
val <!UNUSED_VARIABLE!>c<!>: Comparator<Date?> = comparator {(date1, date2) ->
if (date1 != null && date2 != null) {
date1.compareTo(date2) * -11
} else {
11
}
}
}
fun bar(val i: Int, val a: <!UNRESOLVED_REFERENCE!>U<!>) {
val r = if (true) i else <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a<!>
val <!UNUSED_VARIABLE!>b<!>: Any = <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>r<!>
}
//from standard library
public inline fun <T> comparator(<!UNUSED_PARAMETER!>fn<!>: (T,T) -> Int): Comparator<T> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>