x?.y != null and x?.call() != null provoke now x != null, a set of tests #KT-2127 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
9001b9bcc0
commit
11f50186fa
@@ -11,7 +11,8 @@ val items: ArrayList<Item> = ArrayList<Item>()
|
||||
fun test(room : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>Object<!>) {
|
||||
for(item: Item? in items) {
|
||||
if (item?.room === room) {
|
||||
System.out.println("You see " + item?.name)
|
||||
// item?.room is not null
|
||||
System.out.println("You see " + item<!UNNECESSARY_SAFE_CALL!>?.<!>name)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ public class Throwables() {
|
||||
public fun <X : Throwable?> propagateIfInstanceOf(throwable : Throwable?, declaredType : Class<X?>?) {
|
||||
if (((throwable != null) && declaredType?.isInstance(throwable)!!))
|
||||
{
|
||||
throw declaredType?.cast(throwable)!!
|
||||
throw declaredType<!UNNECESSARY_SAFE_CALL!>?.<!>cast(throwable)!!
|
||||
}
|
||||
}
|
||||
public fun propagateIfPossible(throwable : Throwable?) {
|
||||
|
||||
Reference in New Issue
Block a user