Sign in
pigweed
/
third_party
/
github
/
JetBrains
/
kotlin
/
e1e07d20949869a38f2fc0b6ceeea1235721f07f
/
.
/
compiler
/
testData
/
diagnostics
/
testsWithStdLib
/
smartcasts
/
letAlwaysChangesToNotNull.kt
blob: 6956a81041f21a963d7a1af36f6c790d27dfe81a [
file
]
// KT-9051: Allow smart cast for captured variables if they are not modified
fun foo
(
y
:
String
)
{
var
x
:
String
?
=
<!
VARIABLE_WITH_REDUNDANT_INITIALIZER
!>
null
<!>
y
.
let
{
x
=
it
}
x
<!
UNSAFE_CALL
!>.<!>
length
// Smart cast is not possible
}