[NI] Soften restictions on using Nothing as proper constraint for full call completion
Consider lower `Nothing` constraint non-proper only if there is a dependant not analyzed postponed atom. Early completion to `Nothing` provides data flow info for smart casts. KT-35668 Fixed
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun main() {
|
||||
val baseDir: String? = ""
|
||||
val networkParameters: String? = ""
|
||||
if (baseDir != null) {
|
||||
if (networkParameters != null) {
|
||||
Unit
|
||||
} else if (true){
|
||||
return
|
||||
} else {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
return
|
||||
}
|
||||
|
||||
networkParameters.length // unsafe call
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun main() {
|
||||
val baseDir: String? = ""
|
||||
val networkParameters: String? = ""
|
||||
if (baseDir != null) {
|
||||
if (networkParameters != null) {
|
||||
Unit
|
||||
} else if (true){
|
||||
return
|
||||
} else {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
return
|
||||
}
|
||||
|
||||
<!DEBUG_INFO_SMARTCAST!>networkParameters<!>.length // unsafe call
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
public fun main(): kotlin.Unit
|
||||
Reference in New Issue
Block a user