drop BASE_WITH_NULLABLE_UPPER_BOUND

This commit is contained in:
Michael Nedzelsky
2015-10-14 19:15:08 +03:00
parent ced1edcf98
commit 57205f5721
24 changed files with 23 additions and 46 deletions
@@ -1,4 +1,3 @@
// !DIAGNOSTICS: -BASE_WITH_NULLABLE_UPPER_BOUND
// !CHECK_TYPE
interface A<T>
@@ -1,4 +1,3 @@
// !DIAGNOSTICS: -BASE_WITH_NULLABLE_UPPER_BOUND
// !CHECK_TYPE
interface A<T>
@@ -1,4 +1,3 @@
// !DIAGNOSTICS: -BASE_WITH_NULLABLE_UPPER_BOUND
// !CHECK_TYPE
interface A<T>
+1 -1
View File
@@ -21,6 +21,6 @@ fun tests() {
}
// from standard library
operator fun <K, V> MutableMap<K, V>.set(key : K, value : V) : V<!BASE_WITH_NULLABLE_UPPER_BOUND!>?<!> = this.put(key, value)
operator fun <K, V> MutableMap<K, V>.set(key : K, value : V) : V? = this.put(key, value)
fun println(message : Any?) = System.out.println(message)
@@ -5,4 +5,4 @@ fun test(map: MutableMap<Int, Int>, t: Int) {
}
//from library
operator fun <K, V> MutableMap<K, V>.set(key : K, value : V) : V<!BASE_WITH_NULLABLE_UPPER_BOUND!>?<!> = this.put(key, value)
operator fun <K, V> MutableMap<K, V>.set(key : K, value : V) : V? = this.put(key, value)
@@ -4,6 +4,6 @@ fun foo(): String? {
return accept(JV<String?, Unit?>())
}
fun <R, D> accept(<!UNUSED_PARAMETER!>v<!>: JV<R, D>): R<!BASE_WITH_NULLABLE_UPPER_BOUND!>?<!> = null
fun <R, D> accept(<!UNUSED_PARAMETER!>v<!>: JV<R, D>): R? = null
open class JV<R, D>()
@@ -1,6 +1,6 @@
// KT-3559 Strange inference failure error message
public inline fun <T:Any, R> let(subj: T?, body: (T) -> R): R<!BASE_WITH_NULLABLE_UPPER_BOUND!>?<!> {
public inline fun <T:Any, R> let(subj: T?, body: (T) -> R): R? {
return if (subj != null) body(<!DEBUG_INFO_SMARTCAST!>subj<!>) else null
}
@@ -6,7 +6,7 @@ fun <T> getJavaClass() : java.lang.Class<T> { <!NO_RETURN_IN_FUNCTION_WITH_BLOCK
public class Throwables() {
companion object {
public fun <X : Throwable?> propagateIfInstanceOf(throwable : Throwable?, declaredType : Class<X<!BASE_WITH_NULLABLE_UPPER_BOUND!>?<!>>?) : Unit {
public fun <X : Throwable?> propagateIfInstanceOf(throwable : Throwable?, declaredType : Class<X?>?) : Unit {
if (((throwable != null) && declaredType?.isInstance(throwable)!!))
{
throw declaredType?.cast(throwable)!!
@@ -17,5 +17,4 @@ public class Throwables() {
propagateIfInstanceOf(throwable, getJavaClass<RuntimeException?>()) // Type inference failed: Mismatch while expanding constraints
}
}
}
}