Sign in
pigweed
/
third_party
/
github
/
JetBrains
/
kotlin
/
fae15b3fc4205675bfb51513d6068f83490926d3
/
.
/
compiler
/
testData
/
diagnostics
/
testsWithStdLib
/
smartcasts
/
letAlwaysChangesToNotNull.kt
blob: 6956a81041f21a963d7a1af36f6c790d27dfe81a [
file
] [
log
] [
blame
]
// 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
}