Don't suggest cast when !! is possible #KT-18033 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
af3a123c15
commit
0fd42bc747
@@ -0,0 +1,15 @@
|
||||
// "Cast expression 's' to 'String'" "false"
|
||||
// ACTION: Add 'toString()' call
|
||||
// ACTION: Add non-null asserted (!!) call
|
||||
// ACTION: Change parameter 's' type of function 'bar' to 'String?'
|
||||
// ACTION: Convert to expression body
|
||||
// ACTION: Create function 'bar'
|
||||
// ACTION: Surround with null check
|
||||
// ACTION: Wrap with '?.let { ... }' call
|
||||
// ERROR: Type mismatch: inferred type is String? but String was expected
|
||||
|
||||
fun foo(s: String?) {
|
||||
bar(<caret>s)
|
||||
}
|
||||
|
||||
fun bar(s: String){}
|
||||
Reference in New Issue
Block a user