Add non-null assertion: correct handling of unary expression unsafe calls #KT-13430 Fixed
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
|
||||
class SafeType {
|
||||
operator fun unaryMinus() {}
|
||||
}
|
||||
|
||||
fun safeB(p: SafeType?) {
|
||||
val v = <caret>-p
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
|
||||
class SafeType {
|
||||
operator fun unaryMinus() {}
|
||||
}
|
||||
|
||||
fun safeB(p: SafeType?) {
|
||||
val v = -p!!
|
||||
}
|
||||
Reference in New Issue
Block a user